Providing different "layout boxes"

Permalink
Hi everyone,

this is a problem I have that probably is very simple to solve, but I am afraid I have not been successful in squeezing it into a form search that came up with the answer I need, so please forgive me, should this have been answered already - in that case, I'd appreciate the link.

What I want to do:
Enable my customer to choose between different layout elements when adding content - e.g. a text box with a specific background image or so.

Think of the main column of this page - suppose I have prepared (in the CSS) such a column with dark grey background and rounded corners for ordinary text, and one with the same corners and a green background for, say, testimonial quotes.

When my customer adds content, I want him to be able to choose between the two types of text boxes.
What would be the way to go? Do I need to create a special content block for this, or is there another way?

I hope I could get my point through and would really appreciate advice!

Many thanks in advance!
Per

perdittmann
 
ThemeGuru replied on at Permalink Best Answer Reply
ThemeGuru
You'll be needing a custom layout applied to the content block.

Maybe you want to check out this blog post:

http://www.codeblog.ch/2009/03/concrete5-templates/...

Overall it's not to hard just create a new template and then wrap it with your custom css.

Hope that helps.

-TG
LukeBMM replied on at Permalink Reply
It sounds like what you're looking for is custom templates for the Content block.

Copy '/concrete/blocks/content/view.php' to '/blocks/content/templates/testimonial.php' and add a div around the line that outputs the content. The results will look something like this (without a few comments removed here for clarity):

<?php 
   defined('C5_EXECUTE') or die(_("Access Denied."));
   $content = $controller->getContent();
   print '<div class="testimonial">';
   print $content;
   print '</div>';
?>


Now style the default content block as normal (dark grey) and create the green styles with a .testimonial selector.

Whenever you add a block of content to a page, you can click on it afterward and choose "custom template". Pick testimonial form the dropdown menu and you'll get content wrapped in div.testimonial.


Edit: Ninja'd!
da4kinov replied on at Permalink Reply 1 Attachment
Is there a way to be like attached one