Tell us what you are trying to do?
I want to create a view which is creating accordion based on taxonomy.
For example: Created taxonomies named A, B, C ...
In this case will have 3 accordions - A, B and C.
On expand of each - they will dynamically show content from the Custom post type with its fields based on taxonomy from current taxonomy.
Please advice how to create the loop based on taxonomy and to add it in dynamic accordion.
Thanks.
Update:
I have managed to create the accordion loop based on taxonomy category creation of my CPT.
Added my View to - Content Selection - Taxonomy and in the loop editor - added the code for accordion and it worked (please reffer to the screenshot attached). Now each time a new category for Region is created it will dynamically add new accordion tab.
Now I need to figure how to pull the correct posts based on a category of the "Region" taxonomy in each accordion.
For example I created new posts in my CPT:
Post 1 - Category A
Post 2 - Category A
Post 3 - Category B
======================================
My View created 2 accordion tabs - A and B
So Post 1 and Post 2 need to go in Accordion tab A
And Post 3 need to go in Accordion tab B
======================================
I have attached a screnshot of the custom fields which I have created for my CPT.
Please advice me what code should I put between the panel-body div in my Accordion Views Loop - for my posts to be displayed in the specific category-based accordion tab.
Basically it needs to be user-friendly CPT:
1. Create a new post, add content to the custom fields, assign category to category "Region 1" (which is already there) - it will place it in this category accordion on the front end.
2.Create a new post, add content to the custom fields, assign NEW category "Region 2" - this new category will dynamically be added as a new accordion tab in the front end (which is now solved) and the new post will go there.
Thanks.
Kind regards.
Hello,
What kind of accordions are you using? can you provide a live demo for it?
For example, Bootstrap Collapse, it needs a unique ID for each accordion:
hidden link
You can use term slug as the unique ID
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#vf-153465
Hello, these are bootstrap accordions I believe, please refer to my attached screenshot from last post.
I think that issue is resolved with accordions creation.
Just left to configure the right posts to go to right accordion tabs as I explained from my post above. Please check it as I descibed the situation there with examples.
Thank you.
Kind regards.
Please provide a test site with the same problem, fill below private message box with test site credentials, also point out the problem page URL and view URL, I need to test and debug it in a live website