NO BUG: Dynamic post category

Bricks Version: the latest
Browser: Brave
**Windows /
URLs:
https://www.loom.com/share/d5ae9300eee44ff19ca3a9d2315f1cd3
https://robotics.kampotwebsolutions.com/prime-robotics-blog/

When I pull in {post_terms_category} I get more than just one category returned. Please check out the short loom video which shows the problem.

You can also have a look at the blog itself and try it out.

Thanks for your help.

Hi Dirk,
What exactly is the problem?

Your video doesn’t work, and yes, {post_terms_category} outputs all categories of a post :thinking:

Best regards,
timmse

{post_terms_category:1}
I think it will return one category. But there will be a comma separator at the end. How can i remove that comma?

Not a bug but just my stupidity. I should have used {archive_title} instead of {post_terms_category}. Now it works. Sorry for bothering.

1 Like

Does

{post_terms_category: :1}

work for you?

1 Like

{archive_title} works for me. It returns the correct taxonomy. Cheers

It works but it add an hour comma separator at the end

Should all categories render as a clump…hovering one hovers all (same hover state)? That doesn’t seem right. It would be better output as a list…not a group of links that all hover at the same time with different paths. Is there another option for output without having to do any custom coding?

Hi Keith,
With regard to the hover state, it would make no difference whether it is a list or simply individual a’s, since your hover styles are aimed at the whole element either way, and not at the a’s in it.

Unfortunately, applying styles to nested selectors is still impossible (at least via UI). However, it is of course possible with custom CSS:

%root% .repeater-item [data-field-id="joywbw"] a:hover {
  color: var(--action-hover);
}

AH! It took me a minute to understand where I went wrong here…I see your point. The hover style, applied through the UI, has to apply to the whole chunk of links in the data field. Ok. Thank you for explaining. This is my first time using {post_terms_category} whereby I thought the singular (category vs. categories) would render :hover per link and not apply the hover to all the items. Foolish though this next question may be, is there a way to add something to the dynamic data (e.g., {post_terms_category:something} ) that would separate them so the UI would work? Obviously, you can’t know what fields will be used here in all cases. Just some thoughts to share. Thank you again for the very helpful explanation.