I archived this:
https://toolset.com/forums/topic/build-a-post-grid-with-custom-link/
There i build a Post Grid and all works i mentioned.
But how can i duplicate this? Or with other words i need this a few times on the page just with another Tax output.
Eg. on the one site i only need the posts with category b and on another site i only need to display posts with category c.
How can i fix this that i can use the same grid and just change the tax/category output/filter?
Hello,
I suggest you try these:
1) Create a content template, setup the conditional blocks in it, and display it as what you want
2) In other views/page/post, display a content template block, and choose above content template
https://toolset.com/block-item/content-template/
I did but how can i set up which categories to display?
As i wrote ... i want to use the same template few times.
i tryed this:
[wpv-view name="hersteller-grid" hersteller-kategorie="premium"]
but it dont works.
the custom post type is created like this:
// Our custom post type function
function create_posttype() {
register_post_type( 'hersteller',
// CPT Options
array(
'labels' => array(
'name' => __( 'Alle Hersteller' ),
'singular_name' => __( 'Hersteller' )
),
'public' => true,
'has_archive' => true,
'rewrite' => array('slug' => 'hersteller'),
'show_in_rest' => true,
'supports' => array('title','editor','excerpt', 'author','thumbnail','custom-fields','page-attributes'),
)
);
register_taxonomy('hersteller-kategorien', 'hersteller',
array(
'show_in_rest' => true,
'hierarchical' => true,
'label' => 'Kategorien',
'query_var' => true,
'rewrite' => array(
'slug' => 'hersteller-kategorie',
'with_front' => false
)
)
);
}
What do you mean it does not work?
Please elaborate the questions with more details, provide detail steps to reproduce the same problem, you can also provide a test site with the same problem, also point out the problem page/post URLs, take a screenshot for what you are going to achieve, I need to test and debug it in a live website, thanks
I made the content template as described.
Now when i place it in content i want to choose/filter which category posts should display on page.
Since you are using custom codes to setup the post types + taxonomies, I suggest you try to follow our document to convert those post types + taxonomies to Types control:
https://toolset.com/course-lesson/convert-existing-custom-types-and-fields-to-types-control/
And test again.
Ok so this works now:
[wpv-view name="hersteller-grid" wpvherstellerkategorien="city-trekking"]
Can i only use Shortcode? Its not possible to use Content Template block instead?
The shortcodes you mentioned above is a view's shortcode:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-view
You can put it into a Toolset content template, then display the content template with the content template block
yes i did it with content template block but then i cant choose the category?
it looks like this:
hidden link
and the settings linke screenshot to display the category.
Or what are the right filter settings?
The attribute "wpvherstellerkategorien" is setup in the view's shortcode [wpv-view], so it is expected result: you can not choose "category" in content template.
Content templates are different from post views.
In your case, you just need to add a shortcode block, display the view's shortcode with different "wpvherstellerkategorien" attribute value, for example:
[wpv-view name="hersteller-grid" wpvherstellerkategorien="city-trekking"]
[wpv-view name="hersteller-grid" wpvherstellerkategorien="city-abc"]
[wpv-view name="hersteller-grid" wpvherstellerkategorien="city-def"]
ok so its only possible with shortcode. ...
that would be great features ... for now where block theming is coming more and more
As I mentioned above content templates are different from post views, you can not use views attribute in content template