Sign in

Adding Links in Post templates

  • This topic has 7 replies, 2 voices, and was last updated 12 months ago by .
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #4639
    Moizo

    Hello everyone,

    I’m enjoying using Publii, however I have a bit of an issue when trying to use post templates. When I have a link in the normal editor like:

    
    

     

    It works as intended. However, if I put the same code in a post template, the link doesn’t work anymore. It’ll just add #INTERNAL_LINK#/post/16 to the url of the page you are on. How can I fix this?

    Thanks everyone for the help!

    #4640
    Bob

    Where exactly do you paste the link – to the post-template.hbs file?

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #4641
    Moizo

    Where exactly do you paste the link – to the post-template.hbs file?

    A post template that I made myself called post-TEMPLATE_1_1 and added to config.json. It all works too, just the link in the post template doesn’t.

    #4642
    Bob

    please be precise: do you paste this link to post-TEMPLATE_1_1 or to a post with an assigned post template?

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #4643
    Moizo

    please be precise: do you paste this link to post-TEMPLATE_1_1 or to a post with an assigned post template?

    Inside the post template itself, not in a post where the post template is assigned to. (Links in a post with this post template do still work as intended). Thanks for the replies so far by the way!

    #4644
    Bob

    This way it won’t work, when you use an internal link into post content, Publii parses it to the requested link.
    If you want to use a link into .hbs file you should use, for example,

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #4645
    Moizo

    This way it won’t work, when you use an internal link into post content, Publii parses it to the requested link.

    If you want to use a link into .hbs file you should use, for example,

    Thank you, i’ll look into these!

    #4646
    Moizo

    This way it won’t work, when you use an internal link into post content, Publii parses it to the requested link.

    If you want to use a link into .hbs file you should use, for example,

    I changed it into the following and it seems to work, just want to make sure i didn’t do anything wonky with this:

     

     

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.