?
avatar leetempest
leetempest
4 Jul 2017

Steps to reproduce the issue

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

Expected result

The custom fields should be visible when viewed under a contact category menu item. or the values available for template overrides.

Actual result

Nothing is displayed

System information (as much as possible)

latest Joomla 3.7.2

Additional comments

avatar leetempest leetempest - open - 4 Jul 2017
avatar joomla-cms-bot joomla-cms-bot - labeled - 4 Jul 2017
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 6 Jul 2017

Issue confirmed.

Set Show User Custom Fields on Menu or Contacts for All don't show Values of Fields. Thoughts @laoneo?

avatar franz-wohlkoenig franz-wohlkoenig - change - 6 Jul 2017
Status New Confirmed
avatar laoneo
laoneo - comment - 6 Jul 2017

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).

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 6 Jul 2017

@laoneo

  • adding Fields on Contact
  • set in Menu Item Type List Contacts in a Category > Tab Contact Display Options > Show User Custom Fields to All

Result: Fields aren't shown on Menu

Same if you add Fields at User.

avatar franz-wohlkoenig franz-wohlkoenig - change - 6 Jul 2017
Status Confirmed Discussion
avatar laoneo
laoneo - comment - 6 Jul 2017

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.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 6 Jul 2017

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.

avatar laoneo
laoneo - comment - 6 Jul 2017

The list doesn't show custom fields at all.

avatar leetempest
leetempest - comment - 6 Jul 2017

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?

avatar laoneo
laoneo - comment - 6 Jul 2017

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.

avatar leetempest
leetempest - comment - 6 Jul 2017

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?

avatar laoneo
laoneo - comment - 6 Jul 2017

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.

avatar rdeutz
rdeutz - comment - 6 Jul 2017

@laoneo when then it is something for 3.8

avatar laoneo
laoneo - comment - 6 Jul 2017

I'v opened a pr #17004 which enables custom fields for it. It was indeed a bug, when corrected, brings a new side behavior for the list.

avatar laoneo
laoneo - comment - 6 Jul 2017

This issue can be closed then.

avatar joomla-cms-bot joomla-cms-bot - change - 6 Jul 2017
Closed_By franz-wohlkoenig joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 6 Jul 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 6 Jul 2017
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2017-07-06 16:01:14
Closed_By franz-wohlkoenig
avatar joomla-cms-bot
joomla-cms-bot - comment - 6 Jul 2017
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 6 Jul 2017

closed as having PR #17004


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

Add a Comment

Login with GitHub to post a comment