Silverstripe Version: 4.8.0
How can I make $URLSegment and $InSection(about) work in an include file?
I wanted to assign a class depending on the URLSegment which works perfectly fine in Page.ss.
I tried it on any other pages e.g. HomePage.ss or an included .ss file where I actually only want to use it, but it doesn’t work.
I guess this is intended then or is there anything else I can use to get the last part of the url in other .ss files than the Page.ss?
I know I can work around this and use it on Page.ss level, but I wanted to know if there is a different way as I only need it in one particular case.
Thanks