Forum
Passing blogSlug into a template
Hi,
I'm trying to set up multiple blogs with perch Runway.
In Settings I have the Blog post page path set as /{blogSlug}/{postSlug}/ and all is good. In my post template I can use <perch:blog id="blogSlug" /> and it will output the blogSlug to the page as expected.
I need to use the blogSlug elsewhere, for example in a template to output category and tag link lists.
However using <perch:blog id="blogSlug" /> doesn't output anything when used in the category_link.html template.
I've seen this post https://forum.grabaperch.com/forum/04-26-2016-dynamic-blog-slug-with-multiple-blogs which seems to be the same issue. As described there, I can get the slug from the page url and pass that as a variable into the regular post template with no problem, but it won't pass into the category_link.html template.
Is there any news on this or a solution that you could suggest?
Many thanks in advance for any help!
There's no change to that currently. The best option is to use a different template depending on the blog and add the path into the template.
Hi Drew,
Ok, thanks very much for letting me know. I can certainly do that as a workaround.