Hi! I looked everywhere and i can’t figure this out. Can any of you PHP wizards help me out?
I just want to determine if the current page has an ID in the URL. Like this kind of ID: “Example Domain”. If it has an ID, then i will return the HTML class i want. It should be super simple, but i can’t find it on Kirby docs, and online PHP references are too different for me to understand… Here’s my initial code:
I’ve read about each of the terms in the ref docs but i still don’t understand them. Also i can’t find any info on fragment(). Plus, i don’t know how to combine $url and $id in the IF. Isn’t there any operator that says “HAS THIS” or something similar?
I thought that this would be the best approach, but i’m intrigued with the JS approach, @texnixe. I might start to explore that solution and see if it works well.