It says:
«If you want to include a link to a post on your site, the post_url tag will generate the correct permalink URL for the post you specify. {% post_url 2010-07-21-name-of-post %} »
Does that help in your case?
Best, Michael
Hey @michaelbach
Thanks for coming forward to help
But how can i fetch the contents of that post ?
The tag filter just outputs a string that carries the post url, but I would need the contents of that particular post referenced through the url just something like
I donāt think you can do it as you are basically asking it to loop thru all posts and find this particular one, which is a loop.
Is this just one specific post? or multiple times you want to do something similar? if it is just one then maybe the include is a good idea. Maybe even put the loop in the include and that would only run once maybe? you could pass in the frontmattervariable to the include.
post 1 - Front matter
model: ā05ā
warranty: āfive yearsā
post 2 - Front matter
mode: ā06ā
warranty: āsix yearsā
Help me design a constructor that fetchs the post 2 through mode == ā06ā
And hence print the warranty period of the particular modelā¦
Preferably through your afore mentioned method.(i.e) using where_exp:
And it works as expected
But the thing is it works only for variable title: and any other custom front matter variable fails to return output (shows no error though)
Should i be adding something to initialize the front matter variable in config.yml ?
Yes indeed. Great⦠so now you know what the problem is. Can you try some extra/better escaping of the numbers? Or can you try to enforce āstringā treatment by adding a letter in front of the number?