Skip Navigation

[Resolved] Setting up a taxonomy filter on page with custom functionality

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 – 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/Karachi (GMT+05:00)

This topic contains 4 replies, has 2 voices.

Last updated by Waqar 1 year, 6 months ago.

Assisted by: Waqar.

Author
Posts
#2621173

Luo Yang greatly assisted us with setting up this page:

hidden link

This page is built using these two views:

hidden link
hidden link

I wanted to request getting support from Luo Yang on this ticket since he is already familiar with everything done here.

The first view provides all the data for the javascript added to the page to use with the second view to get the final display. The first view results have display:none; styling added so they won't display on the page, but will still be present to be utilized by the javascript.

I have tried to add a taxonomy filter to the second view to allow end users to select the Tournament/League they would like to see. But the taxonomy filter is appearing under every session on the page instead of just once at the top of the page.

I am fully understanding why this is happening. The page shows the view multiple times, broken down by session as follows:

<h3>Morning - 3.0</h3>
[wpv-view name="teams-posts-by-session" session="Morning - 3.0"]
<h3>Morning - 3.5</h3>
[wpv-view name="teams-posts-by-session" session="Morning - 3.5"]
<h3>Morning - 4.0+</h3>
[wpv-view name="teams-posts-by-session" session="Morning - 4.0+"]
<h3>Afternoon - 3.0</h3>
[wpv-view name="teams-posts-by-session" session="Afternoon - 3.0"]
<h3>Afternoon - 3.5</h3>
[wpv-view name="teams-posts-by-session" session="Afternoon - 3.5"]
<h3>Afternoon - 4.0+</h3>
[wpv-view name="teams-posts-by-session" session="Afternoon - 4.0+"]

So when I add the taxonomy filter to the view, it's going to show it every time the view is displayed on the page. I understand this.

My question is to see if there is any way to add the taxonomy filter to only display once above these session/view displays and have the filter apply to all instances of the view on the page.

If this is not possible, then my workaround will have to be to set up new pages/views duplicating everything done here for every tournament/league. I don't think I'd have any trouble doing this, but it will make our Views admin section VERY crowded over time. So if a filter can be added to this single page, that would be very much preferred. Any advice/help you can offer on this would be greatly appreciated. Getting this functionality to where it can handle multiple tournaments/leagues is my final step in the process of setting up EVERYTHING needed for this site to have Teams, Matches, Schedule , Results, Standings overall, and Standings by Round functionality.

I'm currently going through all the Views that have been set up to achieve everything and trying to add this taxonomy filter capability to everything. I have it working on the Teams, Matches, Schedule and Results functionality. But I can see that the getting this on the Standings overall page that Luo Yang helped with and the Standings by Round pages that Minesh is helping with is going to be more difficult because of the complex approaches that were needed to get these pages working. I hope this can be done, but understand if it can't.

#2621245

Hi,

Thank you for contacting us and I'd be happy to assist.

Luo has moved on to a different role, so I'll be following up on this.

To suggest the most efficient way to achieve this, I'll need to see how these views are set up in the admin area.

Can you please share temporary admin login details, in reply to this message?

Note: Your next reply will be private and making a complete backup copy is recommended before sharing the access details.

regards,
Waqar

#2621605

Thank you for sharing these details.

After reviewing the setup, I've added the following changes:

1. I've removed the 'display:none;' from the page 'Standings by Session', which hides the entire parent view 'Teams List with Total Points and Results'.

2. In the view 'Output Editor' section of the view 'Teams List with Total Points and Results', I've added the 'display:none;' around the '[wpv-layout-meta-html]' shortcode that generates the view's output:


<div style="display:none;">
[wpv-layout-meta-html]
</div>

This way only this view's search filters will show, but not the search results.

3. In the view 'Output Editor' section of the view 'Teams posts by session', I've added the 'display:none;' around the '[wpv-filter-meta-html]' shortcode that generates the view's search filters:


<div style="display:none;">
[wpv-filter-meta-html]
</div>

This way only this view's search results will show, but not the search filters.

As a result, the search form/filters are showing once from the first view and are not repeating from the multiple instances of the second view.

Important note: The first view is set to show the 'Matches' posts, which all have only the 'Inaugural Tournament' taxonomy term. If the results of the second view are dependent on the first one, then items that have a different term, won't show up, when the filtering is performed.

#2621689

Whoa! Slick move Waqar! That's awesome.

Yes, right now all our Matches use the "Inaugural Tournament" taxonomy option. We'll be adding new ones with other options selected soon to test out making this system flexible enough to handle multiple tournaments/leagues. This step here was the last piece to the puzzle for everything with the "Inaugural Tournament" standings. I was given a spreadsheet by the client and had that as my goal to emulate everything displayed/calculated in that spreadsheet. Now I just have to see if I can emulate what you did here in the other open support ticket here to get the same filtering on those pages and I'll have everything. Let me try that myself. It's probably not doable because those pages don't have the same approach with the display: none; bit. But I'd like to look to see if there is a way to apply this thinking to that. I fully understand your approach here. Genius solution. Thanks.

I'll mark this one resolved later today. Thanks as always.

#2622011

I'm so glad I could help and please take your time.

Let me know if you have any follow-up questions and for a new question or concern, you're welcome to start a new ticket.