SOLVED: Basic text as dynamic data get's styling removed after "Link to" applied

Bricks Version: latest
Browser: Chrome 90
OS: Win
URL: https://kamilp1.sg-host.com/project/well-optimized-wp-website-for-the-nail-studio-in-kosice-slovakia/

Strange behavior to me: I have a “Basic text” element which pulls up dynamic data (tag category) and I have it styled (color, transform, …) When I apply a link to it with the “Link to” it removes the styling on the front end (it’s OK in the editor…) plus the link doesn’t work…

Am I just not knowing what I am doing?

https://www.loom.com/share/f633179bae134fb9a0933112929f96e7

Hi Kamil,
Thanks so much for your report!

{post_terms_category} returns the category as a link, and a link in a link doesn’t work :wink:

Best regards,
timmse

Any time. Glad I could help with squashing a bug.

Hi Stefan,

Just on this, is there a way to bring in the post terms category without it being a link, just the text?

Thanks

Mick

Sure, there is a filter:

Alternatively, you can write a custom function that returns the categories without a link and call it with {echo:yourFunction}.

Hi @timmse,

looks like the hook has some problem? I’ve tried to disable links like described, but it isn’t working.

Tobias

Found it. For ACF taxonomy fields you have to add:

add_filter( 'bricks/acf/taxonomy/show_as_link', '__return_false' );`
1 Like

thanks for this - would this ever be something that can be selected from inside the ui without needing the filter? I see a lot of people ask about this online.

Hello @robertobze,

you can use :plain filter, when you are outputting it with a dynamic tag, like this: {post_terms_category:plain}

This should get rid of all links. :slight_smile:

Best regards,
Matej

3 Likes

thanks I knew about this one and used it a lot before,

actually I guess I asked because, I have a particular case at the moment where I am using data attribute using dynamic data, and when I selected categories in the attribute data it came out as a link url. It’s possible to also add :plain also for attribute dynamic data then?

Yes, you can add :plain everywhere where you use this dynamic tag. If I understand you correctly.

Matej

1 Like

awesome! thanks I’ll try it out and let you know.

one more thing, how can I output categories separately instead of together which is default? this is useful for styling badges on blog card and blog posts, for example.

You can always use Query Loop to output categories instead. That way, you can style them however you want :slight_smile:

Matej

2 Likes

can you please let me know what I’m doing wrong here:

still running into this issue … I’m styling the “badges” via dynamic attributes that are on the “p” tags themselves. Using the query loop idea is causing the

to be wrapped in a div when more than 1 category is assigned to a blog post.

Hello @robertobze,

inside the loop, where you have a basic text element, with {post_terms_category} as a content. Can you try to put {term_name} as a dynamic tag.

That should output the category name, without a link, and it should work :slight_smile:

Keep me updated :slight_smile:

Matej.

Hey Matej, thanks - I had that part working already. This is my setup screenshot, followed by the issue I am still running into;

now you can see, that because the output of term name is still “joined” the styling I am applying via attributes isn’t working on blog posts with more than 1 category/term name:

Hope this gives you a better idea of my challenge. If you can help me to solve this, please!!

thanks a lot,

Hi @robertobze,

I think it’s best if you can you send temporary login credentials for your website and a link to this thread to help@bricksbuilder.io using the email address you used during the purchase, then I can take a look.
Please, also add a link to the page, where I can inspect this.

Thanks.
Matej

1 Like

sure I will do that now, thanks Matej !!

another screenshot showing the issue:

info sent via email and user invite sent to the same email as an editor.