Blog entry page with optional thumbnail

Permalink
Hi I have created a blog page type and a blog entry page type. In the blog entry page type I would like to have an optional thumbnail. I have created a thumbnail attribute and I can get the attribute to display correctly using the attribute block. When I edit the output I would like to have an optional column on the left of the content block that displays the thumbnail if there is one. If there is no thumbnail I would like the column to disappear allowing the content to use the full width of the content body.

Does anyone know how to do this?

 
pvernaglia replied on at Permalink Reply
pvernaglia
In your blog entry page type wrap the optional column with an if statement:
<?php
if($c->getAttribute('your_thumbnail_attribute'): ?>
  put the optional column stuff here
<?php
endif; ?>
chillax86 replied on at Permalink Reply
How would I go about putting this code into the blog entry output, do you mean I would need to create a template which has the optional column and the code above in it and then set that as the page type output template?
MrKDilkington replied on at Permalink Best Answer Reply
MrKDilkington
@wcldev

You answered your own question.

- create a new template
- in the template, add the code for the column and displaying the thumbnail attribute inside it
- wrap the column code in an if statement (as the example above) to conditionally display it
- copy the Blog Entry page type or create a new one
- with the new page type, assign the template that has the conditional column code

Here are a few helpful descriptions of Page Types and Page Templates:
http://www.concrete5.org/community/forums/5-7-discussion/page-types...
http://www.concrete5.org/community/forums/5-7-discussion/5.7-page-t...