Smarty Template inheritance, duplicate content documentation

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
atz6975
Forum Members
Forum Members
Posts: 34
Joined: Thu Jan 14, 2010 4:43 pm

Smarty Template inheritance, duplicate content documentation

Post by atz6975 »

Hi,
I ran into this same issue : viewtopic.php?f=8&t=80100&hilit=extends
I'm gratefull that somebody took the time to report this and save me the headache.

Here is my little contribution to the documentation update on the Templating subject (v2.2.x or v2.3). Feel free to inherit/extend/replace ;D

Common pitfalls
Duplicate {content} block : Regardless of smarty principles of template inheritance, the {content} tag (with unique parameters) cannot be present in multiple places (like being extended and replaced in child block).
The duplicate {content} rule is a CMS MS sanity choice and has nothing to do with Smarty inner workings (inheritance).
It is recommended to assign the value of any {content} block (at least the main one) into a variable and replace/extend that variable usage in child templates as you see fit.
{content} and {content bloc="My Page summary"} are two disctinct tags and will not be considered duplicate.

Here is one exemple : https://cmscanbesimple.org/blog/the-pow ... gn-manager.
Post Reply

Return to “CMSMS Core”