Skip Navigation

[Résolu] Parent Child relationships using 'id=$parent' in child post lost

This support ticket is created Il y a 8 années et 5 mois. There's a good chance that you are reading advice that it now obsolete.

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

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

Last updated by timB Il y a 8 années et 5 mois.

Assisted by: Luo Yang.

Auteur
Publications
#349466
correct.png
incorrect.png

This is a site which has 'Product Groups' as a parent CPT for 'Products'.
'Product' pages refer to colors which are custom fields in 'Product Groups' for certain style elements of their pages.

Following is an example of the syntax used in the Content Template of 'Product' pages to get the color from its parent for the background header of a list of related case studies:

<div class="ProductUseHead" style="background-color:[types field='dark' id='$product-grouping'][/types];">Related Case Studies</div>

This works fine, as you'll see, on this page (bottom left sidebar)
hidden link

However, on the following page, the product isn't picking up the value of

[types field='dark' id='$product-grouping'][/types]

So 'Related Case Studies' has a blank background.

I am unable to determine why the same content template works for one post but not another. I'm hoping you can help me fix this.

A further anomaly, which might be related, is that the client needed to move some products from one product group to another recently. Following is a list of the ones concerned:

hidden link
hidden link
hidden link
hidden link
hidden link
hidden link
hidden link

You will see that these products either don't pick up a color from their 'product-grouping' at all, or pick up the one from a different 'product group' (perhaps their previous one) ... but note how this only applies to the sections in the right sidebar and underneath the flyout menu. They are all still able to get the correct colors from their parent Product Group for the top left header text and background. The same syntax is used for setting the colors in this section, as follows:

<div class="prodnav" style="display:block;height:250px;padding:5px 5px 5px 5px;width:240px;border-top-style:solid;border-top-width:6px;border-top-color:[types field='dark' id='$product-grouping'][/types];background-color:[types field='light' id='$product-grouping'][/types];">
  <div style="color:[types field='dark' id='$product-grouping'][/types];font-size:200%; font-weight:bold;text-transform:uppercase;">	
    [wpv-post-link id="$product-grouping"]
    <p></p>
    </div>
    <div style="font-size=100%;color:[types field='dark' id='$product-grouping'][/types];">
       [types field="side-text" id="$product-grouping"][/types]
    </div>
</div>

I would appreciate some help to understand what is causing this, and to put it right. I would be happy to give you Admin access to the site so you can take a duplicate, or just have a look at what might be causing it.

Thank you in advance, for your assistance.

Tim

PS: I'm attaching pngs for Correct layout of a 300 product and Incorrect layout of a 300 product - as examples.

#349637

Dear tim,

There is a know problem in the latest version, which Attribute id="parent_slug" does not work correctly in widget area. It is already in our to-do list, our developers are working on it, I add this thread into it.

Currently please try modify the shortcode, like this:
From:
[types field="side-text" id="$product-grouping"][/types]

To:
[types field="side-text" id="[wpv-post-field name="_wpcf_belongs_product-grouping_id"]"][/types]

And test again.

#349641

Hi Luoy, thanks for that.

I will test it with the new syntax as you suggest.
Can you tell me though, will this work with the new update too, or will it need to be replaced again? There are a lot of places where the $parent call is used, especially in sidebars, so it will help me to know this.

Also, have you any timing yet on when a release will come with this bug resolved?

Many thanks
Tim

#349666

Hi Luoy

The test worked. So I have modified the syntax in all content templates which appear in sidebars.

I'm marking this as resolved, for now, therefore.

Many thanks
Tim

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.