Skip Navigation

[Résolu] Problems with listing parent fields in child content template

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 2 réponses, has 2 voix.

Last updated by jamesH-3 Il y a 7 années et 4 mois.

Assigned support staff: Paweł Pela.

Auteur
Publications
#231921

I have created a child content template and added a view to include some of the merchant filedz in the child template. However, it does not seem to work. It does list the fields multiple times. I need to show:
Parent Title
Parent Field 1
Parent Field 2
Parent Field 3
Parent Field 4
Parent Field 5
Parent Field 6
Parent Field 7

What it lists is something like:

Parent Title
Parent Field 1
Parent Field 2
Parent Field 3
Parent Field 4
Parent Field 5

Parent Title
Parent Field 1
Parent Field 2
Parent Field 3
Parent Field 4
Parent Field 5
Parent Field 6

Parent Title
Parent Field 1
Parent Field 2
Parent Field 3
Parent Field 4
Parent Field 5
Parent Field 6
Parent Field 7

I have also tried to set Display 1 item from Limit and Offset option but it then showed only:
Parent Title
Parent Field 1
Parent Field 2
Parent Field 3
Parent Field 4
Parent Field 5

Here is the view I am using:

[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<div style="padding:0px 10px 0px 10px;margin-bottom:10px;-webkit-border-radius:2px 2px 2px 2px;-moz-border-radius:2px 2px 2px 2px;border-radius:2px 2px 2px 2px;border:1px solid #DED9D9;background-color:#EFEFEF;">
<wpv-loop>
<h4>[wpv-post-title id="$merchant"]</h4>

[list]

[wpv-if businessaddresslinecondition="wpcf-business-address-line" evaluate="!empty($businessaddresslinecondition)"]
[list_item icon="fa-map-marker"][types field="business-address-line" id="$merchant"][/types] [types field="business-city" id="$merchant"][/types] [types field="business-postcode" format="FIELD_VALUE" id=""][/types][/list_item][/wpv-if]

[wpv-if businesstelephonecondition="wpcf-business-telephone" evaluate="!empty($businesstelephonecondition)"][list_item icon="fa-phone-square"][types field="business-telephone" id="$merchant"][/types][/list_item][/wpv-if]

[wpv-if businesswebsitecondition="wpcf-business-website" evaluate="!empty($businesswebsitecondition)"][list_item icon="fa-laptop"][types field="business-website" id="$merchant"][/types][/list_item][/wpv-if]

[wpv-if businessemailcondition="wpcf-business-email" evaluate="!empty($businessemailcondition)"][list_item icon="fa-envelope"][types field="business-email" id="$merchant"][/types][/list_item][/wpv-if]

[wpv-if businessregistrationcondition="wpcf-business-registration-reference" evaluate="!empty($businessregistrationcondition)"][list_item icon="fa-pencil"][types field="business-registration-reference" id="$merchant"][/types][/list_item][/wpv-if]

[/list]

[wpv-if businesslogocondition="wpcf-business-logo" evaluate="!empty($businesslogocondition)"][types field="business-logo" size="thumbnail" align="center" resize="proportional" id="$merchant"][/types][/wpv-if]

</wpv-loop>

</div>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]No items found[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]

How can I list all 7 fields only once?

Thanks

#231924

Dear James,

Sorry for the inconvenience!

We already have a patch for this issue. I have sent it to you via email along with the instructions on how to apply it.

I will be closing this thread for now, if you still have problems please open a new thread.

Regards,
Paweł

#231948

Hi Pawel
Thanks for the quick response; however, it did not fix the issue.
I have just created a new thread: https://toolset.com/forums/topic/problems-with-listing-parent-fields-in-child-content-template-2/
Thanks