Link Menu and Nav (strange issue)

So I’m new to Kirby and fairly new to php.

I was working on my site and followed the instructions here for setting up redirects.

This worked great and added links to my menu and everything seemed well and good. I uploaded my site to my hosting to test and make sure everything was working. Which it does.

But now on my local side the links no longer work and it’s driving me nuts. Instead of navigating to the external link it adds the link to localhost/my-site.

I’m running xampp on win10. Any help would be appreciated.

tldr; external links work server side but no longer work locally.

Nvm, I think I figured it. I still don’t completely understand but I tried to create my own templates copying the link.yml folder and for whatever reason they were the issue. I switched back to the link template and all is good.

Welcome to Kirby :slight_smile: I must admit, I don’t quite understand what you did, so I’m afraid I can’t really explain what might have gone wrong. Are you talking about a link.yml blueprint? Templates have the extension .php

If you want to edit those pages with their fields in the Panel, you would need a link.yml blueprint in /site/blueprints which is not explained in the tutorial, because its a bit oldish…:wink:

Oh yes so I have a link.yml (blueprint) file which looks like.


title: Link

icon: instagram

options: 
  template: true

pages: false

files: false

fields:
  title:
    label: Title
    type:  text
  
  link: 
    label: Link to the page
    type:  url

I used the word ‘template’ because in the ‘panel’ for the link that’s what it said.

So what happened was I copied and pasted the yml file and made 2 more one for dribble and one for instagram just because I wanted to see the icon in the panel. No other real reason. =)

The link.yml works and locally the links works. If I switch the the dribbble or instagram yml files they no longer work. =/

So in the end you had three yml files in the blueprint folder, right?

  • link.yml
  • dribble.yml
  • instagram.yml

which are all the same, except for the icon?

Then your text files now have different names as well, link.txt, dribble.txt and Instagram.txt. For this setup to work, though, you would need three different templates, link.php, dribble.php and instagram.php, otherwise Kirby will use the default.php template if it can’t find a template with the same name as the text file.

Nevertheless, I think that using several different templates/blueprints somehow defeats the purpose, if you want to add another link, you would have to create yet another blueprint/template. Maybe a link icon would be sufficient.

By the way: For blocks of code please use three backticks (```) on a separate linke before and after the code block. Thank you.