User tests: Successful: Unsuccessful:
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.
(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');
Status | New | ⇒ | Pending |
Category | ⇒ | Front End com_contact |
@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 :)
@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.
@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.
Title, Introtext, Image, Createddate + Pagination > huge Step.
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.
Labels |
Added:
?
|
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 :)
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?
Status | Pending | ⇒ | Information Required |
I have tested this item
@henkrijneveld can you please retest?
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
Status | Information Required | ⇒ | Needs Review |
Status is set on "Needs Review".
You could create an override for Modules: Articles - Category, include it in contacts and filter by the author too :)
Let's decide whether to include the following:
->select('a.introtext')
->select('a.images')
Please rebase for j4.0. thx.
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
|
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.