Proper way to link to sitemap-hidden pages

Post

Posted
Rating:
#4573 (In Topic #921)
Joe

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.

Post

Posted
Rating:
#4574
Joe
Here's another interesting fact:

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.

Post

Posted
Rating:
#4577
I can't reproduce this. Composr does turn '_' to '-' in URLs, but then it converts it back again. I'd need FTP (or similar) access to a test site showing the problem to debug it.

Post

Posted
Rating:
#4580
Joe
Not sure what happened, but I can't seem to reproduce it either. I'll keep an eye open and keep you posted if it happens again.
2 guests and 0 members have recently viewed this.