Tell us what you are trying to do?
Hi, I'm trying to create a content slider called "recommended articles", to appear at the bottom of a single post. The site I'm working on has 10 categories. Each slider is different, depending upon the category that the post is in.
Is there any documentation that you are following?
Toolset knowledge base.
Is there a similar example that we can see?
I already built this on a site using Beaver Themer. However, I discovered that Beaver Themer is not compatible with WPML. Therefore, I want to rebuild this with Toolset.
You can see what I did here (it's in Hebrew):
hidden link
What is the link to your site?
hidden link
The site I'm working on has 10 categories. Each slider is different, depending upon the category that the post is in.
You can use Views to create a Slider, and add a Query Filter based on taxonomy (category) term. You can configure that Query Filter to be set by the current page's terms (see the screenshot here). Then only content that matches the current post's terms will be shown in the Slider. Once you have created this View, you can insert it in the template you have created for this post type, using the Fields and Views button.
If you'd like more information about creating sliders with Views, please see our documentation here:
https://toolset.com/documentation/user-guides/creating-sliders-with-types-and-views/
If you'd like more information about filtering content by taxonomy, see our documentation here:
https://toolset.com/documentation/user-guides/filtering-views-by-taxonomy/
Hi, I tried sorting the view I created by category.
It is still appearing in other categories that I did not associate it with.
How do I reopen this ticket? I was sick last week and unable to follow up on this.
Hi, I tried sorting the view I created by category.
Well sorting and filtering are different things, so maybe there was a miscommunication here. If I understand your explanation, you need to add a Query Filter, separate from sorting. If you cannot see the Query Filter in the View editor screen, scroll to the top right corner and click "Screen Options". You can activate the Query Filter panel here.
If that's still not working as expected, I'll be glad to log in to your wp-admin area and take a closer look. Please provide login credentials in the private reply fields here.
Thank you. After examining your site and carefully reading your comments again, I realize I do not understand completely. I need a bit more clarification from you. You said you want to have 10 different sliders, based on the category of the current post. Please explain more about the contents of these sliders, and how the contents relate to the current post. Let's assume your post categories include "red", "blue", and "green".
- When a User visits a post in the "red" category, what content will exist in the slider? Are they posts in the same post type, or posts in another post type, or what?
- Will the content shown in the slider content also have the "red" category term, or is there some other way the content is related to the current post?
- What if the current post is in multiple categories, like "red" and "blue"?
Thanks.
When a User (not a registered user, by the way) visits a post in the "red" category, the slider will display more articles from the "red" category. As in "you might also like these articles..." These would be posts in the same post type.
The content shown in the slider will have the "red" category term. That is how it is related to the current post.
If the current post is in multiple categories, like "red" and "blue", the slider show content that is from the "red" and "blue" categories.
When a User (not a registered user, by the way) visits a post in the "red" category, the slider will display more articles from the "red" category. As in "you might also like these articles..." These would be posts in the same post type.
Okay this is essentially what I was describing in my response here: https://toolset.com/forums/topic/i-need-to-create-a-content-slider-that-is-conditional-upon-post-category/#post-1183153
I see one View:
hidden link
The View and taxonomy filter are configured to display "Posts" associated to one specific term:
הגירה לישראל
(Immigration to Israel, in English)
Your Content Template for Posts contains this View:
hidden link
So if you want the View to respond to the terms associated with the current Post, you must adjust the taxonomy term filter as I described earlier. Set it up so that the term filter is determined by the page where this View is shown. Please carefully read my response here, and check the screenshot:
https://toolset.com/forums/topic/i-need-to-create-a-content-slider-that-is-conditional-upon-post-category/#post-1183153
My example taxonomy is called "Book taxes" but yours will be "Categories".
Once you have made that adjustment, please let me know which results are not accurate, and why. Thanks for your help. I do not read Hebrew so it is a challenge for me to understand which results should be correct.
Thanks.
It's my understanding that the View that I created is all set up properly in regards to the Query Filter (see attached image).
The following link is of a post that is in a different category, yet still displays the content slider: hidden link
The following link is of a post that is in a different category, yet still displays the content slider:
Right, because the Query Filter does not determine where the View appears, it determines which posts appear in the results. You're confusing a Query Filter with conditional display of a View.
1. Conditional display of the View means you must create 10 different Views, each with a different Query Filter, and then write conditional HTML logic to show different Views in different posts. More about conditional HTML: https://toolset.com/documentation/user-guides/conditional-html-output-in-views/
2. A Query Filter based on the current post lets you create 1 View, and place the same View in all posts. It's more efficient and less work for you.
It's my understanding that the View that I created is all set up properly in regards to the Query Filter (see attached image).
No, it's not quite right. Your Query Filter is configured to only display one static category of results. If you want the View to respond to the terms associated with the current Post, you must adjust the taxonomy term filter. Set it up so that the taxonomy term filter is determined by the page where this View is shown. Please carefully read my response here for an example and screenshot of the filter options:
https://toolset.com/forums/topic/i-need-to-create-a-content-slider-that-is-conditional-upon-post-category/#post-1183153
Thank you! I finally got it. Problem #1 solved. I still have 8 problems to go(!).
The next problem - the design changes when the slider moves.
I designed what the slider should look like in Beaver Builder, but the design looks different when the slider moves:
hidden link
See the attached images.
Is there a way for the slide to retain its design when it slides?
Great, we can discuss the styling issue in the new ticket. Our policy is to address one issue per ticket - it helps us keep the forum organized. Thanks!
My issue is resolved now. Thank you!