Create custom fields within Contacts. Add additional content to custom fields. Create a Contact Category menu item. View the page via the frontend and no custom field data is displayed. I have a forum post here also:
https://forum.joomla.org/viewtopic.php?p=3481582#p3481474
The custom fields should be visible when viewed under a contact category menu item. or the values available for template overrides.
Nothing is displayed
latest Joomla 3.7.2
Status | New | ⇒ | Confirmed |
Can you post a screenshot about the menu item you have. I don't really understand where exactly the custom fields are not displayed.
@franz-wohlkoenig the setting you are mentioning imports the custom fields of the user and should not be relevant for this issue (when I got it right).
Status | Confirmed | ⇒ | Discussion |
Do you expect on the field to show it up in the list? The fields are only displayed in the contact details.
Keep in mind the setting you are talking about imports the custom fields of the connected user.
I understand @leetempest that he wan't to get Fields also to show at a List – i also understand the Menu-Options in this Way. And User-Fields are also not shown in a List.
Let's wait for @leetempest so he can write what he mean.
The list doesn't show custom fields at all.
Ok I'll try and clear up the confusion. I'm currently building a site for a company that has multiple office locations. I have created a different contact for each of these locations using the core contacts component to add address and contact details. I have also created some custom fields for the opening hours of each location. I have then created a com_contact -> List Contacts in a Category menu item to display the locations. I can handle the styling of the content displayed via template overrides and CSS etc. However I want to display these opening times custom fields on this page also so the user does not have to click through to see opening times.
It appears from what I can see the custom fields are not available in this view/ template override. Form my limited PHP when I var_dump the data for the menu page it does not list the custom field data.
Does that make sense now?
Yes that's true, the related event is not fired per contact. IMO it would make sense to add it, but it will have an impact on performance.
I can do a pr, but @rdeutz has to decide if this new feature is something for the 3.7.x series or if it should be done against 3.8.
laoneo,
Thanks for the reply, it maybe I'm the only one using Joomla that needs this type of feature request!
Do you know the database call I could use in the template override to at least get something working?
Basically you need this code in your override JFactory::getApplication()->triggerEvent('onContentPrepare', array('com_contact.contact', $this->item, $this->params, 0));
.
[Update]
Wrong code, please use the fix from the pr mentioned below if you can't wait till version 3.8 as intermediate solution.
This issue can be closed then.
Closed_By | franz-wohlkoenig | ⇒ | joomla-cms-bot |
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-07-06 16:01:14 |
Closed_By | ⇒ | franz-wohlkoenig |
Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/16961
closed as having PR #17004
Issue confirmed.
Set
Show User Custom Fields
on Menu or Contacts forAll
don't show Values of Fields. Thoughts @laoneo?