Skip Navigation

[Resolved] Trying to insert a Parent Taxonomy Title in a View Whose Parent Is Set by Parent

This support ticket is created 4 years, 10 months ago. 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.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by shawnW-3 4 years, 10 months ago.

Assisted by: Nigel.

Author
Posts
#1544625
taxonomy-parent-title-screenshot.JPG
nested-views-screenshot.jpg

Tell us what you are trying to do?
I have nested views to show the entire product line, the product series, and the products - ie, parent category, child category, posts

What I want to do is have the wpv-taxonomy-title for the product line (parent) show above the wpv-taxonomy-title for the product series (child).

I've tried a few different things, like making a new view that just shows the title of categories whose parent is none and then inserting that view back into the child view, but without a special term filter or way to tie to each child, that obviously just list out all the parents.

I'm hoping there's a term or attribute that will make this easily work.

Is there any documentation that you are following?
In addition to the above, I tried a shortcode that I found on a post, but it didn't work and I didn't want to spend too much time on it as I'm hoping to avoid custom php functions. If there's no way around that, we can work with php shortcode, but I'll definitely need specific help for this example.

Is there a similar example that we can see?
Screenshots below show how it's currently setup as well as the intended result of this support ticket.

I want the parent category title... REDLINE to appear above the child category titles... 100 Series... 200 Series... etc.

What is the link to your site?
Currently IP blocked

#1544643

Also, if I could get someone in my timezone, like Shane, I'd appreciate it.

#1545327

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

You can use shortcode attributes to pass the title of the parent term to the child View, as described here: https://toolset.com/documentation/user-guides/views/passing-arguments-to-views/#accessing-the-arguments

In the parent View where you insert the child View you can add an arbitrary attribute to the wpv-view shortcode which you can then retrieve in the child View using the wpv-attribute shortcode: https://toolset.com/documentation/user-guides/views/views-shortcodes/#wpv-attribute

So with your example, you might insert the child View in the output section of the parent View like so:

[wpv-view name="child-terms" parent="[wpv-taxonomy-title]"]

Then in the child View you can output what was passed via the "parent" attribute (I could have named that anything) with:

<p>Parent is [wpv-attribute name="parent"]</p>
#1547221

Thank you very much sir! It took a bit to wrap my head around this, but worked perfectly as you said. You may want to consider expanding the documentation on that to include more examples, but my issue is resolved now. Thank you!