Adding Links in Post templates
- This topic has 7 replies, 2 voices, and was last updated 3 months, 1 week ago by .
- AuthorPosts
- December 1, 2020 at 10:15 am#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!
December 1, 2020 at 10:39 am#4640Bob
SupportWhere 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!December 1, 2020 at 10:50 am#4641Moizo
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.
December 1, 2020 at 10:53 am#4642Bob
Supportplease 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!December 1, 2020 at 10:56 am#4643Moizo
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!
December 1, 2020 at 11:03 am#4644Bob
SupportThis 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,- @website global variables: https://getpublii.com/dev/website-global-variable/ or
- {{#getPost}} helperhttps://getpublii.com/dev/getpost-helper/ what you can nicely connect with the https://getpublii.com/dev/posts-dropdown/
--
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!December 1, 2020 at 11:06 am#4645Moizo
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,
- @website global variables: https://getpublii.com/dev/website-global-variable/ or
- {{#getPost}} helperhttps://getpublii.com/dev/getpost-helper/ what you can nicely connect with the https://getpublii.com/dev/posts-dropdown/
Thank you, i’ll look into these!
December 1, 2020 at 11:31 am#4646Moizo
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,
- @website global variables: https://getpublii.com/dev/website-global-variable/ or
- {{#getPost}} helperhttps://getpublii.com/dev/getpost-helper/ what you can nicely connect with the https://getpublii.com/dev/posts-dropdown/
I changed it into the following and it seems to work, just want to make sure i didn’t do anything wonky with this:
- AuthorPosts
- You must be logged in to reply to this topic.