Proper way to link to sitemap-hidden pages
Posted
#4856
(In Topic #1066)

Standard member

using the PAGE_LINK symbol
Maybe it's a bug or possibly I'm not doing something right.If I have a page prefixed with an underscore (this hides it from showing up on the sitemap), it seems impossible to link to it using {$PAGE_LINK}. Oddly, using this symbol replaces the underscore with a dash, resulting in a "not found" error when clicking on the link generated by this symbol.
For example. Let's say I have a page located in the Welcome zone, like so… :_test
If I use {$PAGE_LINK,:_test}, the link is transformed into: /index.php?page=-test (with a dash instead of an underscsore)
Now if you have a page called -test and use {$PAGE_LINK,:-test} (with a dash), it will successfully link to that page.
I could setup a page-redirect so that all directs to -test are referred to _test (I haven't tested this yet, it should work in theory, right?) but that could be too many redirects for individuals with many underscored pages as they'd have to set up a redirect for each.
In short, I think the {$PAGE_LINK} symbol should support linking to underscored pages (or pages hidden from the sitemap), as currently it appears that it does not support this.
Posted

Standard member

If you navigate to a page that doesn't exist with a dash in it (i.e. -test), the "not found" error says that _test isn't found.
Posted

Site director

Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Posted

Standard member

1 guest and 0 members have just viewed this.