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
Differentiate blog post types in post_in_list.html
I've got a couple of different blog post types and would like to give each an icon on the blog index page, depending on what the content is. For example, I'd like a post from a video post type to have a class of 'video' on the <li> on the index page. I'm trying this but it doesn't work:
My video post template in /templates/blog/posts/ has a hidden field with a default value:
<perch:blog id="video_marker" type="hidden" suppress="true" default="video" />
I was hoping this would automatically populate the database entry for each video post type with a value of 'video' so that I could then pull the class back out in the post_in_list.html template with the 'video_marker' ID like this:
<li class="hentry <perch:blog id="video_marker" />" >
I'd then be able to have a film camera icon that sits next to each video-centric post (<li class="video">), generated with my CSS.
Do you know if there's a way to achieve this?
Want to reply to this thread?Login with Perch