Single page layout builder display taxonomy name

I have a CPT that has 2 taxonomies. Job Position and Location.

I am creating a layout for the CPT in the layout builder. I want the value of the terms chosen in the taxonomy displayed on the single page.

What is the snippet that I need to use? {{dc:term:name}} will not work for me.

Hi @designerken,

Thanks for reaching out!

To show the tags name on your single page, you need to create a div for your tags and enable the consumer provider. Then select current post term as your type and tags as your taxonomy.

image

Then to show the taxonomy name the dynamic code is {{dc:term:title}}, you can check in this video starting at 7:25 on how it works.

Hope that helps.

Thank you.

Hi @marc_a

I actually discovered that last night and used something similar.

Now a formatting question…
I have this dynamic code {{dc:term:name}} / in a text element, but as you can see in the screen shot it places each element on its own line. The intent was for it to be wrapped in the text box and the last item to not have the /. Can this be achieved without any fancy JS?

On the front end it renders each term is wrapped in its own < div class=“x-text” > element.

This is what we are trying to achieve:

Screen Shot 2021-02-10 at 7.35.53 AM

FYI these are currently not links to their archive pages, just text.

Hi @designerken,

You can add the link for specific term inside the text element using dynamic content {{dc:term:url}} with the a tag. Please find the following code for example.

<a href="{{dc:term:url}}">{{dc:term:name}}</a>

The terms are showing in the individual line as the looper provider might be integrated into the column which has the 100% width, you can try by adjusting the width or following custom CSS code into the Element CSS.

$el.x-col
{  
    flex-basis: unset !important;
}

Please remember that the above code will work if copied as it is and don’t conflict with any existing style.
Please note that the code provided serves only as a guide to help you get started custom coding on your own if there’s no option offered in our theme or the products we bundle.
We really do not provide support for custom codes that means we can’t fix it in case it conflicts with something on your site nor will we enhance it.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.