Content container templates - Presentation options


(Michael Valk) #1

Matrix Version:
v5.4.3.2

Hi, I am using Content Container Templates for various design elements.

I need to have the option of adding a wrapper div (with classes) to the Container Templates (for padding options, background colour, etc.).

I thought that I could just use the “presentation = block (div)” option in the container options - but this doesn’t work - it looks like only wraps the %asset_contents% in a div, not the entire Container Template.

See below:



Do you know if there is any way of achieving this?

Cheers,
Michael


#2

If this is something you want the page editor to control, then use conditions that check the metadata options to change the output in the paint layout format.

For example:

<div class="%asset_metadata_Classname%">%asset_contents%</div>

or

%begin_asset_metadata_Wrapper^eq:Yes%
    <div class="wrapper">
%end_asset%
%asset_contents%
%begin_asset_metadata_Wrapper^eq:Yes%
    </div>
%end_asset%

(Tyson Adams) #3

Hi Michael,

You could add the wrapper in a Simple Edit Layout asset applied to the Content Template, and then just use keywords within them to print your metadata and contents.

<div class="content-wrapper">
    %__custom-contents%

    %metadata-F_metadata_values%
</div>

Hope that helps


(Michael Valk) #4

Thanks very much for your response - I guessed I might have to do something like that as an alternative.


(Michael Valk) #5

Hi Tyson, thanks for this. It looks like your code is in reference to the appearance within Edit+ (useful to know, thanks), but my issue was with how the content displayed on the front-end. I think I’ll have to go with bkelly’s solution if there’s no alternative.

Cheers,
Michael