Hide element on specific urls using conditions

I want to hide an element if the url includes a specific term. I have tried reading through the documentation and forums, but can’t find a similar case, even though I expect a simple solution.

As an example, I want to hide the element on all pages that has “TERM” in the URL.
website.com/TERM/
website.com/TERM/success
website.com/TERM/help

I know I can use use Page (Specific) and select specific pages in the condition, but in this case I need a more dynamic solution, that use the URL instead.

Hey Anders,

Thanks for reaching out!

You can try this one in the element condition Term in {{dc:url:full_path}}.

Hope that helps and let us know how it goes.

Ok. I don’t get that to work. I might have used a bad example. I didn’t mean “Term” as in Post term. It was an example of a string inside the url. As an example, I want to hide the element in all URLs contain the string/word “trial” in the URL.

Like:

I can use the {{dc:url:full_path}} option, but then I would have to list all specific urls, which is not really what I want to do here.

SCR-20240906-icha-2

Hi Anders,

As per the URL structure described in your first post, you can use {{dc:url:segment}} to get the TERM and compare it. If you want any other value from the URL, you can use the specific index for that, like {{dc:url:segment index=“1”}}.

Hope it helps.
Thanks

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