I’m trying to use site variables such as $site, $pages and such within a function but it just isn’t working. I’ve managed to get around this by passing them in from my snippet file which is calling the functions eg myfunction($site, $pages) but now I am trying to use routes also it doesn’t seem to work.
What is the scope of using these within routes or how would i use them.
At present i am trying to use the below code to no avail, once again trying to put the $pages var in as a variable purely because of my frustration.
You have to pass the URI of the page instead of the UID to the page function. Your page paramater should probably be something like blog/article/how-to.....