Skip Navigation

[Resolved] Filter set with view shortcode attribute and custom field search

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

Problem:
How to filter view with multiple taxonomy filters with "And" clause

Solution:
To filter view by multiple taxonomy with "And" clause change the Taxonomy relationship to "AND" clause.

You can find proposed solution, in this case, with the following reply:
https://toolset.com/forums/topic/filter-set-with-view-shortcode-attribute-and-custom-field-search/#post-901594

Relevant Documentation:
https://toolset.com/documentation/user-guides/filtering-views-by-taxonomy/

This support ticket is created 6 years, 7 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 9 replies, has 2 voices.

Last updated by Jernej Kozole 6 years, 7 months ago.

Assisted by: Minesh.

Author
Posts
#900934

I want to use a view on many pages where the difference between them is the taxonomy value.
For example: On a single page I only want to list taxonomies books where the custom search field (dropdown) taxonomy year.

There is no issue about this.

When you set the host the example is here - hidden link
The shortcode view works but it does not understand the url parameter for the search.

The site is: hidden link
The site is not online. You have to change your host configuration to this server #194.249.15.100 slogi.si hidden link

#901084

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - do you mean that:
=> You are filtering the view with year on this url and it displays the filtered results belongs to selected year: hidden link
=> now you will click on any post and you will be redirected on the single post page
=> so on this single post page at bottom of the page you are listing the posts
=> you want to filter those posts by the selected year - correct?

#901390

Hello Minesh.

Sorry for the late response .

=> you want to filter those posts by the selected year - correct? CORRECT.

On this page I'm calling this view.
[wpv-view name="publikacije-iskalnik" wpvzbirka="dokumenti-slogi"]

"wpvzbirka" is a taxonomy and "wpvletnik" is a taxonomy for the year. Why is the filter not working?

Kind regards,

#901463

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - I need to check your view's configurations and check on your install why its not working.

Could you please send me problem URL.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#901544

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Could you please check now.

I've modified the code in your following view as given under to pass the URL param to single page:

<a href="[wpv-post-url]?wpvletnik=[wpv-search-term param='wpv-letnik']">
  <div class="list wp-post-image">
    
    [wpv-if image="_thumbnail_id" evaluate="!empty($image)"]
    [wpv-post-featured-image size="seznam"]
    [/wpv-if]
    
    [wpv-if image="_thumbnail_id" evaluate="empty($image)"]
    <img width="710" height="375" src="<em><u>hidden link</u></em>" class="attachment-magazine size-magazine wp-post-image" alt="" />
    [/wpv-if]    
    
  </div>
</a>

As you can see we are passing URL param wpvletnik and assign it the value from URL param wpv-letnik . You can use this method to pass the URL param where applicable.

?wpvletnik=[wpv-search-term param='wpv-letnik']

Now, once you click on the image, it will redirect you on single page - for example:

<em><u>hidden link</u></em>

Where I have change the view's query filter to filter by the URL param.
=> hidden link

Could you please confirm it works for you.

#901554

I'm sorry, i was not clear enough.

The problem is, that I want to have 1 view for a lot of pages, where the only difference is the taxonomy set by attribute shortcode. And then the filter from another taxonomy.

On the example page below. The filter by year is not working. I have set all taxonomy letnik for this 5 posts, but when I select one it is not removing all others.
hidden link

I'm sorry for the misunderstanding.

Kind regards

#901572

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

On the example page below. The filter by year is not working. I have set all taxonomy letnik for this 5 posts, but when I select one it is not removing all others.
hidden link
==> Sorry but I see the year filter is working when you click on search button.

Additionally, I see you have added view's shortcode as given under:

[wpv-view name="publikacije-iskalnik" wpvzbirka="dokumenti-slogi"]

Could you please be specific exactly what is your need with test case example, few screenshots will be helpful to understand your issue so that I can guide you in right direction.

#901580
empty.jpg
2015.jpg

On the empty.jpg image is the initial view and 2015.jpg the view with filter set.

You can see that on both images i get the same result.

#901594

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Could you please check now. I've change the filter to filter by URL param and also change the Taxonomy relationship to "AND" clause.

Now, when i filter and select 2015, it displays only 2015 results. is this your expected output?

#901598

That's it! it was the AND condition. I completely forgot that.

Thank you!