Forum
Blog - sectionSlug
How would i go about getting the section slug into a link in a blog template. My initial assumption was that I could use
<perch:blog id="sectionSlug" />
But sectionSlug doesn;'t seem to be exposed in that way.
Any thoughts?
It should be - can you tell us more about the context?
The Blog on the site I am developing is in two sections - "news" and "blog" Each with their own pages at the URLs /news/ and /blog/ respectively.
This all works fine, apart from when you add archive/tag/category links into the sidebar, as my site makes use of a base tag. So these links goto archive.php?=xxxx relative to the root of the site. So I need to add the sectionSlug to the generated link so that it is /news/archive.php?=xxxx etc.
This is the code I am using for example in month_month_link.html template
but this generates the link
not
as expected.
Using Perch 2.4.9 (planning on upgrading to 2.5 today) PHP 5.4.14 MySQL 5.1.71-log Installed apps: content (2.4.9), perch_mailchimp (2.0.1), perch_blog (4.0.3)
I'll update to Perch 2.5 and Blog 4.1 respectively and see if that helps
All updated and still the same. Nice to see the Assets stuff though. This is going to be a brilliant addition :)
Which page functions are you using to output this template?
Try this at the top of your page:
Perfect. Thanks Drew :)
I may be back with more questions before this build is out ;)