Code: Select all
{block name='content_area'}
<div class="header clearing">
{content assign='subtitle' block='subtitle' label='Page Subtitle'}
<h2>{$subtitle}</h2>
{content assign='pagelink' block='pagelink' label='Page Link'}
{content assign='pagelinktext' block='pagelinktext' label='Page Link Text'}
{if $pagelink != '' && $pagelinktext != ''}
<a href="{cms_selflink href=$pagelink}" class="button more">{$pagelinktext}</a>
{/if}
</div>
<div class="wrapper">
{$main_content}
{if $pagelink != '' && $pagelinktext != ''}
<a href="{cms_selflink href=$pagelink}" class="button mobile">{$pagelinktext}</a>
{/if}
</div>
{/block}
Code: Select all
{extends file='template:Default'}
{block name='content_area'}
{$main_content}
{/block}
I've had to assign {content} to {$main_content} because it was complaining about duplicating the main content block, which is what makes me think it parses it even if you replace the contents of the block in the sub-template.
This isn't too bad for just the content block as assigning it isn't very difficult - but it means all of the content blocks defined in the original template (which I don't want in the sub template) still appear on the sub template page.
Is this the expected behaviour or am I missing something? Is there another way to do it without creating a separate template?
Or is the easiest way to have a master template that has neither set of content, then two templates that extend it - one for the set of content blocks and one for the simplified content?