Hi there
Before purchasing Toolset, I raised a pre sales question (link here - https://toolset.com/forums/topic/toolset-front-end-forms-for-custm-post-types-divi/?key=fc78GONnHVeo - point 2 with a screen shot example added) about adding Accordions (or a similar content set up) to show taxonomy based information on single custom post pages. The information is quite lengthy and split into different topics, so needs something like accordions to make it manageable.
So I have set up my custom post type (Case Studies) and taxonomies, an archive page, custom fields and a couple of text posts. All is working as it should. I have also managed to recreate what Agnes described in the above pre-sales question ... getting the taxonomy basic description to appear on single post type pages, that are of that particular taxonomy.
The archive page with the two test posts is here - hidden link and if you click on either of the two posts, part way down the content on the right hand side, is the one sentence description I added to the taxonomy description - (Testing Brownfield Desc & Testing Greenbelt leisure Description)
I have two questions:
1. How do I replace that basic Taxonomy description with something more complex such as accordions? I'm using Divi builder so ideally, a layout part, containing the accordions with taxonomy specific info and the custom post template draws in the correct builder layout part into the rest of the page content (which will be submitted by a front-end form by an non-registered site user).
2. I'm not sure I understand the taxonomy structure fully. I have added some taxonomies to the custom post type set up. Then on the individual custom posts, I have added child categories. It's these child taxonomies that I have then added the description to. However, when I go to the field and views options in the text editor, the taxonomies that show up to select from are the parent taxonomies and not the child ones. So I'm selecting the parent taxonomy to show the description, but the description is coming from the child taxonomy that has been selected for that post. I've attached a picture to try and show what I mean, which shows the steps I've taken. Does it all look correct to you?
Many thanks
Richard.
1. How do I replace that basic Taxonomy description with something more complex such as accordions?
In order to use Divi Builder effectively here, you'll need to create a View of this Taxonomy, filtered by term, where the term is set by the current post. For now, insert the taxonomy term title in the loop. Place this View in the Content Template for your single post page, and you should see a list of terms associated with the current post.
Next, we want to replace the term title with a Content Template, created by Divi Builder. Create a new Content Template with Divi Builder that includes an accordion module. Each item in the accordion includes a content area where you can use Views and Types shortcodes to display information from each term or its custom fields. See below for some additional information about using these shortcodes. Then insert this Content Template in the loop of your Taxonomy View, and you should find an accordion module appearing for each term associated with the current post.
2...However, when I go to the field and views options in the text editor, the taxonomies that show up to select from are the parent taxonomies and not the child ones.
Okay the Greenbelt Policy button you've circled is used to insert a list of all the Greenbelt Policy taxonomy terms associated with some post. That's not what you're trying to do. Instead, in a View of a custom Taxonomy, you will find a button "Taxonomy field" in the section "Taxonomy data". This is how you add custom field information from a taxonomy term. See tax-field.png. If you cannot find this button in the Fields and Views popup, create a new View of your Taxonomy and look for the button there. Insert the shortcode, then you can copy + paste it into the editor you were using before.
Hi Christian
Many thanks for the speedy response. I have it working almost as I need 🙂 It turns out that we are going to be using the parent taxonomy for the selection of this taxonomy specific info, rather than the child taxonomy. This means it's working as required, without referring to your points in '2' of my list of questions (though the info is still useful).
If you take a look at hidden link and see the case studies 'shopping centre' and 'golf course', they show the accordion headed Economy and the 'Quarry' case study shows the 'brownfield' accordion. All good.
The only minor issue I have, is that the posts are showing the 'no items found' message for the taxonomy included in the single post template, that isn't being used. They'll be about 12 parent taxonomies in the end, so would be good to hide this message and without it shifting the accordion section down the page, if there is a line inserted for each taxonomy that isn't showing. Will it work if I just remove the line from the loop? Can I remove that entire section from the loop?
Image attached.
Thanks again
Richard.
You can remove everything inside the wpv-no-items-found shortcodes like this:
[wpv-no-items-found][/wpv-no-items-found]
That should prevent extra information from being displayed.