What is the best way to detect virtual (generated on the fly) pages?
The primary use case is for hooks.{top|bottom}.where clauses. I do not want my hooks to appear in the π tag listing pages (when you click a tag) as well as in the π pages (the search results pages). I tried where page !=~ /^π/ but without success. Thanks for sharing some ideas.
Normally, I use queries to see what kind of objects and values are there to be potentionally matched in the object of interest (page, in this case). But this canβt be done with the virtual (generated on the fly) pages! So I think that accessing data in these pages should be documented? @zef
thatβs because pages donβt have the βpageβ as attribute but as βtagβ. Have you tried βnameβ instead of it? where tag = "page" and name !=~ /^π/
or the same simpler without the need of regex where tag = "page" and name !=~ "π "
But the correct syntax for widget hooks to achieve this would be:
hooks.top.where: 'name !=~ "π "'
or to include both and
with regex:
hooks.top.where: 'name !=~ /^π / and name !=~ /^π /'
without Regex:
hooks.top.where: 'name !=~ "π " and name !=~ "π "'
EDIT: sorry for the many edits, I was experimenting and discovering things on the go, and edited my initial reply, to not create multiple replies.