This is a different approach to template design. It is the creation of a container class, Div, that allows the content editor (or designer) to style the div and store the settings as content.
The div content is object relations into the system. This allows a great amount of design control, without requiring template or CSS modifications.
The intent of this class and template is to allow page-specific styles, images, and layouts to be applied to single pages, without creating node override templates or custom classes. Page-specific images that are placed in CSS files create a significant amount of overhead, and this alleviates that overhead, and makes the images more manageable.
The objective of the class is primarily layout, to divide the {$module_result.content} area into divs that can be managed as eZ content, instead of templates with CSS files. It is a recursive looping template, that first delivers a named div, then the style tags of the container, followed by the styled div, and including the children, with the same approach. The children use object relations to refer to content within the system.
The class has the following attributes:
{def $children=fetch('content','list',hash(parent_node_id,$node.node_id,sort_by,$node.sort_array))} <div name="{$node.name|wash}"> <style> #{$node.name|wash} {ldelim} {$node.data_map.style.content} {if $node.data_map.background_image.has_content} background-image: url({$node.data_map.background_image.content.original.url|ezroot('single','full')}); {/if} {rdelim} </style> <div id="{$node.name|wash}" class="{$node.data_map.class.content|wash}" > {if $children|count|gt(0)} {foreach $children as $k => $v} {node_view_gui content_node=$v view="full"} {/foreach} {else} {def $related_objects=fetch('content','related_objects',hash('object_id',$node.object.id,'all_relations', true()))} <div id="{$node.name|wash}" class="{$node.data_map.class.content|wash}" > {foreach $related_objects as $k => $v} {node_view_gui content_node=$v.main_node view="line"} {/foreach} {/if} </div> </div> {undef}
Article provided by eZpedia
All text is available under the terms of the GNU Free Documentation License
Powered by eZ Publish 6.0.2stable
Hosted by USA eZ Publish Community Partner : Brookins Consulting