We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum
How can I use separate templates for different blog sections
Hi, I'm trying to use blog sections to create 2 different post types (posts and special offers) that I want to present differently, i.e. I want to use different templates for each section - is this possible or am I barking up the wrong tree?
I'm using blog/index.php to list the posts section:
'sort' => 'postDateTime',
'sort-order' => 'DESC',
'template' => 'post_in_list.html'
This works fine. I am using special-offers/index.php to list the special offers section: <?php perch_blog_custom([ 'count' => 4, 'section'=>'special-offers', 'sort' => 'postDateTime', 'sort-order' => 'DESC', 'template' => 'section_list.html' ]); ?>
Ideally the postSlug urls generated by the section_list.html template would output something like: special-offers/post.php?s=my-post-slug rather than blog/post.php?s=my-post-slug. That way I could use a different post.php to display the special offers using a different template.
This is the button link from section_list.html template <button><a href="<perch:blog id="postURL" />">Read More</a></button>
Is there some way to modify the postURL to get this to work? Or is there a simpler and better approach?
Want to reply to this thread?Login with Perch