Design conditional based on current url containing /_edit


(Gjboyd7) #1

Is it possible to do a conditional within a design based on the current page URL which is being visited.

We want to do this to meet this requirement.

Within our design asset for our Matrix login screen, we are trying to display 404 content to users who visit an Under Construction page, which does not have /_edit in the current URL. To avoid public users trying to login and getting confused.

If /_edit is found in the current url, show the login screen content.

Is it possible to access the visited page URL from a design asset and perform a conditional on that?


(Bart Banda) #2

Yep, I’d probably use the Show If Design area with a condition check on a server variable

https://matrix.squiz.net/manuals/designs/chapters/show-if-design-area#server-variable

With the server variable check being on if REQUEST_URI contains /_edit

Would that work?


(Gjboyd7) #3

That worked perfectly. Thanks Bart.