? Failure

User tests: Successful: Unsuccessful:

avatar AndySDH
AndySDH
16 Mar 2017

Right now, the Contact Articles (articles written by an author) View (com_contact/contact/default_articles.php), has very limited possibilities on what fields it can show. While we can leave the default layout as it is, we should at least allow web designers that want to improve that view in a template override to be able to call for more fields, so we should make them available in the com_contact/models/contact.php. Specifically, I added introtext, images, and publish_up. Also it might be worth noting that right now default_articles.php uses a.created instead of a.publish_up to order articles, maybe using the latter would be more appropriate.

Summary of Changes

(changed in bold)

$query = $db->getQuery(true)
->select('a.id')
->select('a.title')
->select('a.introtext')
->select('a.images')
->select('a.publish_up')

->select('a.state')
->select('a.access')
->select('a.catid')
->select('a.created')
->select('a.language');

avatar AndySDH AndySDH - open - 16 Mar 2017
avatar AndySDH AndySDH - change - 16 Mar 2017
Status New Pending
avatar AndySDH AndySDH - change - 16 Mar 2017
The description was changed
avatar AndySDH AndySDH - edited - 16 Mar 2017
avatar joomla-cms-bot joomla-cms-bot - change - 16 Mar 2017
Category Front End com_contact
avatar AndySDH AndySDH - change - 16 Mar 2017
The description was changed
avatar AndySDH AndySDH - edited - 16 Mar 2017
avatar henkrijneveld henkrijneveld - test_item - 31 Mar 2017 - Tested successfully
avatar henkrijneveld
henkrijneveld - comment - 31 Mar 2017

I have tested this item successfully on 5e96eaf

Tested OK, but seems to just address a specific need. Dont know how often it will be used.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14671.

avatar AndySDH
AndySDH - comment - 31 Mar 2017

@Bakual Thanks, I agree :) Here's just an example of what can be accomplished with those additional fields available: https://www.thesmackdownhotel.com/channel/wwe-2k
Not even using introtext here. With introtext, you could even replicate a blog layout exactly. Well, except for pagination... pagination would be another cool thing to be added to Author Articles, Wordpress does have it. But this is outside the scope of this PR :)

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 24 May 2017

@AndySDH where to find Settings for introtext, images and publish_up after applying PR?

avatar AndySDH
AndySDH - comment - 24 May 2017

@franz-wohlkoenig There are no settings, as the Contact Articles options are really really limited right now. We only have "Show User Articles (Show/Hide) and "# Articles to List" (Contact Articles options would definitely need some love overall, but I understand it's far from being a priority)

So right now the only way to customize the output of Contact Articles is not via options but by overriding the template file of com_contact/contact/default_articles.php

All this PR does is making more fields (introtext, images and publish_up) available to be used in said overrides.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 24 May 2017

@AndySDH got it, thanks for Info. I thought its about Core-Options (which i would like).

avatar AndySDH
AndySDH - comment - 24 May 2017

@franz-wohlkoenig Ideally, it would be fantastic if Contact Articles could use the same options as Category Articles (with options for both Blog Layout / List Layout), including pagination. Currently it's a display of it's own and it's very limited. But I assume that would be a big project.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 24 May 2017

Title, Introtext, Image, Createddate + Pagination > huge Step.

avatar AndySDH
AndySDH - comment - 24 May 2017

Yeah, so maybe you guys can consider it for the future. Perhaps to use the same "shared" Article settings as Categories.
But for now, this is meant to be a simple addition for those who simply want to use those fields in an override on their own.

avatar rdeutz rdeutz - change - 27 May 2017
Labels Added: ?
avatar AndySDH
AndySDH - comment - 26 Jul 2017

Hello, what is the status of this small fix being added? Newer and newer Joomla updates keep coming out yet this keeps seeming to be left out, so I'm finding myself to always having to core-override it on each update.
Thanks :)

avatar AndySDH
AndySDH - comment - 8 Nov 2017

It might be worth noting that right now default_articles.php uses a.created instead of a.publish_up to order articles, maybe using the latter would be more appropriate.

I noticed that this was low-key fixed in 3.8.2, not sure if there was another PR for it.

I also noticed that ->select('a.publish_up') was added to the list of available fields, so we're almost there haha :) However ->select('a.introtext') and ->select('a.images') still weren't added. Any chance those get added too?

avatar franz-wohlkoenig franz-wohlkoenig - change - 8 Nov 2017
Status Pending Information Required
avatar infograf768 infograf768 - test_item - 9 Nov 2017 - Tested successfully
avatar infograf768
infograf768 - comment - 9 Nov 2017

I have tested this item successfully on 8d93a4a


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14671.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 9 Nov 2017

@henkrijneveld can you please retest?

avatar AndySDH
AndySDH - comment - 9 Nov 2017

Hey guys, please note that now the components/com_contact/models/contact.php file is very different in 3.8.2 than what it was when this PR was first opened, so the whole content of the file in this PR would be conflicting with the current one.

But the only difference is adding these lines to the current one in the same position as before:
->select('a.introtext')
->select('a.images')

It works just fine, using it on my site (which is updated to 3.8.2)
https://www.thesmackdownhotel.com/channel/wwe-2k

avatar franz-wohlkoenig franz-wohlkoenig - change - 26 Nov 2017
Status Information Required Needs Review
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 26 Nov 2017

Status is set on "Needs Review".

avatar coolcat-creations
coolcat-creations - comment - 17 Jul 2018

You could create an override for Modules: Articles - Category, include it in contacts and filter by the author too :)


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14671.

avatar Quy
Quy - comment - 12 May 2019

Let's decide whether to include the following:

->select('a.introtext')
->select('a.images')
avatar HLeithner
HLeithner - comment - 13 May 2019

Please rebase for j4.0. thx.

avatar HLeithner HLeithner - close - 13 May 2019
avatar HLeithner HLeithner - change - 13 May 2019
Status Needs Review Closed
Closed_Date 0000-00-00 00:00:00 2019-05-13 07:44:51
Closed_By HLeithner
Labels Removed: J3 Issue
avatar AndySDH
AndySDH - comment - 14 May 2019

Created this: #24897

Add a Comment

Login with GitHub to post a comment