Skip Navigation

[Resolved] One more follow-up question

This thread is resolved. Here is a description of the problem and solution.

Problem:

For some lists, there won't be any subcategories (ie none of the taxonomy terms used), and for those lists, I would ideally like to fall back to a different view instead.

Solution:

You can register the taxonomy subcategories to both post types, for example:

https://toolset.com/forums/topic/one-more-follow-up-question/#post-1246859

Relevant Documentation:

This support ticket is created 5 years, 6 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.

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 2 replies, has 2 voices.

Last updated by matthewC-9 5 years, 6 months ago.

Assisted by: Luo Yang.

Author
Posts
#1246852

OK, great - that worked! One more follow-up question: for some lists, there won't be any subcategories (ie none of the taxonomy terms used), and for those lists, I would ideally like to fall back to a different view instead. Right now I've got:

[wpv-layout-start]
[wpv-items-found]
<h2>[wpv-attribute name="term_title"]</h2>
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-post-body view_template="loop-item-in-online-resource-take-2"]
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[wpv-view name="online-resource-description-for-list"]
[/wpv-no-items-found]
[wpv-layout-end]

This is close, except that the online-resource-description-for-list view repeats once for each taxonomy term from the parent view. Is there a different way to accomplish this without the repetition?

#1246859

Hello,

This is expected result.

As a workaround, you can try these:
1) Register the taxonomy "subcategories" to both post type: "resource" and "resource list"
2) Edit teach "resource list", setup the terms of taxonomy "subcategories"
3) Edit the parent taxonomy view, add a filter:
Taxonomy is set by the page where this View is inserted
4) In section "Loop Editor", within shortcode [wpv-no-items-found]...[/wpv-no-items-found], display your different view shortcode:
[wpv-view name="online-resource-description-for-list"]

#1247371

That worked great! I wouldn't even call it a workaround. 🙂 Thanks!