This works fine if there is just one level of subpages in the blog folder, but it doesn’t with more sublevels. Is there a way to employ the "Mighty mighty URI-Objects (I can’t find this article anymore on the kirby site) to do this?
I am searching for an expression that would say: ‘blog/’. page URI minus the first folder…
Thanks for the quick reaction. Changing from any to all didn’t really change anything on my end. I thought it has more to do with this line:
if(!$page) $page = page(‘blog/’ . $uid);
because it only constructs a url with “blog” and the next subfolder uid, while all the folders in between the current UID and “blog” get ignored…
thanks, @texnixe. This doesn’t work either, and now i am starting to loose track on what it means.
but what i think shouldn’t work is this: ‘blog/’.$uri should create a url like this:
“blog/blog/currentpage” because the $uri object already contains the blog part, right? i was just wondering if there is a way to construct a path with “blog”.$uri-without-the-first-level.
But i am not sure, since i can’t really read and understand even the original blog function… I can only assume that the line
if(!$page) $page = page(‘blog/’ . $uid);
basically lays out the case of a subpage of “blog”.
That doesn’t make sense, you mix both $uid and $uri now (see my comments above), you have to stick with the variable name you pass to the anonymous function, no matter what you call it.