Skip Navigation

[Resolved] taxonomy not displaying correctly

This support ticket is created 5 years, 5 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 11 replies, has 2 voices.

Last updated by johnB-43 5 years, 5 months ago.

Assisted by: Shane.

Author
Posts
#1282045
Annotation 2019-07-02 174047.jpg

I am trying to:
Set up a pre-query filter in a way similar to that described here: https://toolset.com/forums/topic/pre-querying-a-parametric-custom-search-view/
I checked how to do this on this page: https://toolset.com/documentation/user-guides/filtering-posts-by-user-selected-taxonomy/

My view loop is:

[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<div class="pre-select-box">
<wpv-loop>
<p>[wpv-post-taxonomy type="tax-exchange-type" format="name"]</p>
</wpv-loop>
</div>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-layout-end]

The shortcode listed in the help page is '[wpv-taxonomy-title]', not '[wpv-post-taxonomy]'. But it doesn't work that way (as in, the page with that view displays nothing), and when use the Fields and Views button to add a shortcode, this is what it comes up with.

Link to a page where the issue can be seen:
It's under construction and I won't be able to make it available just now.

I expected to see:
A list of available options in the taxonomy tax-exchange-type, each linking to the /places-to-go page with the relevant filter applied.

Instead, I got:
A list of all possible combinations of the taxonomy options used in all posts. As in, if a particular tax-exchange-type has been applied to three posts, it is displayed three times. If a single post has two tax-exchange-types assigned, an item is displayed with both those shown together.

The links seem to work fine, as in each of the instances of a tax-exchange-type displayed links to the same /places-to-go page with the filter.

How do I set this up so the view doesn't display the same taxonomy option multiple times?

#1282101

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi John,

Thank you for getting in touch.

I suspect that the view is displaying the taxonomies of a Post in a parent view ?

Could you let me know if this Taxonomy view is added to a Post view or is it just added to a content template for a post?

Please let me know.

Thanks,
Shane

#1282945
Annotation 2019-07-03 114540.jpg

Thanks for the quick reply. It's added in a post view, not using a content template.
I followed the advice from this page https://toolset.com/documentation/user-guides/filtering-posts-by-user-selected-taxonomy/
It specifically says to just create another view for the filters (also, is the page outdated, given that the shortcode doesn't work?)

#1283241

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi John,

Thank you for the screenshot.

Would you mind allowing me to have access to the site as well as access to this page where you are testing this ?

The private fields will be enabled for your next response.

Also the document is still relevant.

Thanks,
Shane

#1283533

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi John,

This view here is a duplicate.

What you are trying to achieve is to use another view to display the taxonomy terms of the current post in the search view correct?

#1283535

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

this view here hidden link

#1283997

Yes, that is correct. I thought this is what the article I linked recommended. If there is another way to pre-select a taxonomy before displaying the view, I would happily go for it.

#1284107

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi John,

Actually this view here is a Post view
hidden link

What you need to do is to switch this view to a Taxonomy view. Then add a query filter to this view for the taxonomy term and set it to display for the current post.

Then you can add this view to the parent search view and it will display the terms of the current post in the view loop.

Please let me know if this is clear.

Thanks,
Shane

#1284169

Aaaah! I see, this makes perfect sense. I completely missed the fact that I selected the wrong type of view. Thank you!

#1284177

Actually, one more question. This all works fine now. But I was hoping that after I pre-select the Exchange Type and get ported to the site with the filter already on, the dropdown menu where this filter is listed in that view will have this option selected and I will be allowed to select a different one if I change my mind. But it doesn't. How can I make this part work?

#1284285

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi John,

Actually this won't work because you are using a dynamic filter for taxonomy.

I know for custom fields you might be able to do this with the hook below.
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_custom_field_filter_original_value

But for taxonomies there isn't a hook to get this done.

Thanks,
Shane

#1287611

That's a shame! But that's an extra, thank you for solving the main problem in the first place!