I have a portfolio site where I want to hide a few projects so they aren’t visible if you come from the root, but are visible if you enter from a
That seems easy enough to do, as I can just add that as a route alias for the home page, and show the hidden projects on the home template if
root() returns false.
The tricky part comes in on the project pages themselves. I have them set up for next/previous sibling navigation, but there’s no way for a project page to know if you came from the
/showhidden home or the regular home. So if the next page is a hidden one, there’s no way to tell whether to show it, or the next non-hidden page.
I think the way to do this is by adding route aliases to the individual project pages. So each project page has its default
/projectname url and its
/showhidden/projectname alias. But now the home page has to add
/showhidden to all the project urls if it’s being accessed from its hidden alias, and then the project pages have to know they’re being accessed from the hidden alias and correctly adjust their sibling page collections… and I’m not really sure how to do that.
Am I going about this the right way? Is there a simpler alternative? Should I just do this the dumb way and make a copy of all the content in an actual ‘/showhidden’ directory?