Body design area pulls through the title & adding display conditions


(Tara Young) #1

I’m trying to create an area where the title is in a “well” class along with some selected dynamic html content.

I noticed when I use the design area body it automatically pulls through the heading - can these be separated?

Also I would like to be able to pull through a content div into the well under the title, when it has a certain class, i.e. ‘intro text’.

At the moment I’m using metadata fields to populate the intro text, however I don’t think it’s the best possible solution. I was hoping to add something similar to the design area

<MySource_AREA id_name="featured_intro" design_area="show_if">
    <MySource_SET name="condition" value="keyword_regexp"/>
    <MySource_SET name="condition_keyword" value="asset_metadata_intro"/>
    <MySource_SET name="condition_keyword_match" value="Yes" />
         <MySource_THEN>
             <div class="well">
                <h1><MySource_PRINT id_name="__global__" var="asset_name" /></h1>
                <p>this content is getting pulled through from the first content div with a class of "intro"</p>
            </div>
        </MySource_THEN>
        <MySource_ELSE>
             <MySource_AREA id_name="pageTitle" design_area="asset_lineage" print="no" /></MySource_AREA>
         </MySource_ELSE> 
    </MySource_AREA>

<MySource_AREA id_name="page_body" design_area="body" />

Can anyone see where I’m going wrong? Or can see a better solution?


(Bart Banda) #2

The page_body design area only prints the heading for certain asset types, for example News Item assets, but shouldn’t do it for Standard Pages.

You are probably better off doing something like this in a Paint Layout using conditional keywords (https://matrix.squiz.net/manuals/keyword-replacements/chapters/conditional-keywords)

That way you could easily do stuff like:

%begin_asset_metadata_intro^eq:intro text%
    print some stuff here if the metadata field equals "intro text"
%else_asset%
   otherwise, print something else
%end_asset%

Would that help?


(Tara Young) #3

Hey Bart, yes I will go down that route for sure thanks for clarifying!!

The page_body design area is printing the heading on all of my standard pages. I’ll investigate further and log a job if I cannot see any errors.


(Bart Banda) #4

Ah, maybe you already have a Paint Layout that prints the heading in there? Check the Paint Layouts screen of the asset you are working with, it’s type format layout might be printing the page name already.