Duplicate content blocks; template inheritance Topic is solved

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
10010110
Translator
Translator
Posts: 217
Joined: Tue Jan 22, 2008 9:57 am

Duplicate content blocks; template inheritance

Post by 10010110 »

So, I have a global page template that defines the default content in a block, like so:

Code: Select all

{block name="top"}
	…
	{content assign="main_content" label='Some text' scope="global"}
	…
{/block}
Then I have a child template that extends the default, replacing the default block content:

Code: Select all

{extends file='cms_template:Global'}

{block name="top"}
	{content assign="main_content" label='Some different text' scope="global"}
{/block}
I would assume it would just replace the default content block but it complains about duplicate blocks. What’s the deal? And how do I change the content label in different templates?
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1630
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Duplicate content blocks; template inheritance

Post by DIGI3 »

There can only be one default {content} tag in the hierarchy of templates, it's where cmsms does all its cmsms-y things. The easiest option is to move it further down in the hierarchy (so it's not even in the parent template).
Not getting the answer you need? CMSMS support options
Post Reply

Return to “CMSMS Core”