Linking to a page on same website

In the Panel in a Writer field I’ve highlighted some text and linked to another page on the same website.

I’ve then gone to the page and clicked the link, but get the following error message:

The URL should be http://localhost:8888/PI-site-v12/workshops/guitar-making (I’ve check and the page is there)

Why is the link not working?

1 Like

From some more digging around…

It seems that Kirby generates a “permalink” to pages (on the same website), so that if the page is moved, the link will still work.

Unfortunately, this means the link is to a meaningless row of numbers and doesn’t link to the actual page.

The work around is –

In template files we have to add ->permalinksToUrls()

For example

<?= $page->content()->kirbytext()->permalinksToUrls() ?>

Perhaps this is just me, but this seems a right pain. I’m going to have to go through all my templates adding this. Am I missing something – why doesn’t this work be default? Why would we want links that don’t work?

  1. These permalink links usually work, tmight have to do with your setup, maybe because of the ports, not sure, I always use host names
  2. If you don’t want to use the method everywhere, you can solve this with a route that replaces all permalinks, I think there is even a plugin somewhere.
  1. These permalink links usually work, tmight have to do with your setup, maybe because of the ports, not sure, I always use host names

Okay, I’ll not use the ->permalinksToUrls() and see if it works when I make the site live.

If they still don’t work I might need some help. I’m trying to avoid plugins as it looks way too difficult to instal for my liking.

Thanks

Looks like you are using a subfolder setup, so PI-site-v12 is your project folder, that’s why it doesn’t work: UUID permalinks cause infinite redirects in subfolder setups · Issue #6003 · getkirby/kirby · GitHub

Why? Or in what way?

Looks like you are using a subfolder setup, so PI-site-v12 is your project folder, that’s why it doesn’t work: UUID permalinks cause infinite redirects in subfolder setups · Issue #6003 · getkirby/kirby · GitHub

In that case I think when I move the site to the server and it becomes live the permalinks should work.

As for not wanting to use plugins:
• Kirby does everything I want without having to use a plugin so far.
• I’m nervous about installing them. The installation process seems to use words that I don’t know what they mean, like Composer and Git.
• The few plugins I’ve looked at don’t seem to have any instructions, or if they do they are on something called GitHub. It’s not something I’m familiar with or comfortable with.

That’s worked. The site is no longer in a subfolder and the permalinks work. Thanks