Skip Navigation

[Resolved] Show view the same

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

Last updated by michelL 1 year, 4 months ago.

Assisted by: Minesh.

Author
Posts
#2508645

I created a view on my home page (hidden link)
I want to use this view and template on different parts on my website only with different filter options.
So when I change this template it will change the design of all the view templates.

Then I want to use view on the below page with the filter options <bij de boer> <2 persons>
hidden link
Or filter options <op-een-eiland> <4 persons> for his page:
hidden link

Is this possible?

#2509493
ct4.jpg

Hello,

You can assign different content template to each post:
https://toolset.com/course-lesson/creating-templates-to-display-custom-posts/
see my screenshot ct4.jpg
In each content template, display different post view with custom search form.
https://toolset.com/course-lesson/creating-a-custom-search/

#2511781
op een eiland.PNG
View.png

Hi Luo,

Thank, so I can use only the view in yellow rectangle without the filter (pic attached).
I want to use it in a template with different dynamic post views, so by the picture attached show 12 houses 'op een eiland'

#2512049

For the question:
I want to use it in a template with different dynamic post views

You can setup different content templates, in each content template, setup and display different post views.

Edit each single post/page, assign it with above content template differently.
Please let me know if you need more assistance for it.

#2512235
2.png
1.png

I have a Template ''Inspiraties'' and I want to show a view with the category ''ligging'' (1.png).
So the page hidden link will only show the products with the category op een eiland.
And hidden link will only show the products with the category in een dorpje.

Is this possible and how do I set the filter?

#2514301

Minesh
Supporter

Languages: English (English )

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

Luo is on vacation. This is Minesh here and I'll take care of this ticket. Hope this is OK.

As I understand, you want to display the posts belongs to the current post term. What if you select the option with the taxonomy filter you added "Value set by the current page where this View is shown";
=> https://toolset.com/documentation/legacy-features/views-plugin/filtering-views-by-taxonomy/

does that helps?

#2514895

Hi Minesh,

When I do that there will be No items found 🙁
hidden link

#2515137

Minesh
Supporter

Languages: English (English )

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

Can you please share admin access details and let me review what's going wrong with your setup.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) to your site.

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

#2516163

Minesh
Supporter

Languages: English (English )

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

The issue was that the taxonomy "ligging" is assigned to post type "Huisjes huren" and you added the view on post belong to post type "inspiratie":

Could you please check now.

I've added the following "wpv_query_filter" hook to "Custom Code" section offered by Toolset with code snippet "toolset-custom-code":
- hidden link

add_filter('wpv_filter_query', 'func_filter_view_by_current_page_slug', 99, 3);
function func_filter_view_by_current_page_slug( $query_args, $view_settings, $view_id ) {
    
    if($view_id == 46807 ){
     
      $terms = explode("/",$_SERVER['REQUEST_URI']);
      
      if(isset($terms[3]) and !empty($terms[3]) ) {
        
       $query_args['tax_query'] = array(array(
                    'taxonomy'=> 'ligging',
                    'field' => 'slug',
                    'terms' =>  $terms[3],
                    'operator' => 'IN',
                    'include_children' => 1
                ));
          
      }             
     }
    return $query_args;
}

Do you see it works as expected.

#2516491

My issue is resolved now. Thank you!

#2518925

Hi Minesh,

I've made some changes and now it doesn't work anymore.
Dumb on my part.

Now I have
taxonomy "Ligging"
-- Alleenstaand
-- In een dorpje
-- Op een eiland

taxonomy "Type huisje"
-- B&B
-- Blokhus
-- Boerderij

I've already tried to change the code but I can't, can you change it for me?

In the future I also want to apply more taxonomies and taxonomies with multiple filters. So, for example, the taxonomy "location" and then with an extra filter such as two rooms. Does this also work? Or do I have to change the code for this?

New threads created by Minesh and linked to this one are listed below:

https://toolset.com/forums/topic/split-show-view-the-same-add-more-filters/

#2519315

Minesh
Supporter

Languages: English (English )

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

I'm splitting the ticket as your original issue was resolved. We will continue with the following split ticket.
- https://toolset.com/forums/topic/split-show-view-the-same-add-more-filters/

You are welcome to close this ticket by adding different message/

#2519821

My issue is resolved now. Thank y

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.