Monday 05 May 2003 8:01:34 am
Here's quick and dirty example of a multipage article, consisting of two classes.
MultiPage Article (class id 6)
Attributes:
- Title (text field)
- Intro (xml field)
- Body (xml field)
MultiPage SubPage (class id 7)
Attributes:
- Title (text field) - Body (xml field)
file: full_class_6.tpl {* Full class template for Multipage Article *}
<h1>{$node.name}</h1> <p>Last updated {$node.parent.object.published|l10n(datetime)}</p>
<div class="block">
{attribute_view_gui attribute=$node.object.data_map.intro} </div>
<div class="block">
{attribute_view_gui attribute=$node.object.data_map.body} </div>
{let children=fetch('content', 'list', hash(parent_node_id, $node.main_node_id, class_filter, include, class_filter_array(7))) }
{* Subpages *}
<td width="140" valign="top" align="left">
<ul>
{section show=$children}
<h2>Sections</h2>
<li>{$node.name}</li>
{/section}
{section name=Child loop=$children}
<li><a href={$Child:item.url_alias|ezurl}>{$Child:item.name}</a></li>
{/section}
</ul>
</td> {/let}
File: full_class_7.tpl {* Full class template for Multipage SubPage*}
{let children=fetch('content', 'list', hash(parent_node_id, $node.parent_node_id, class_filter, include, class_filter_array(7))) }
<div class="block">
{attribute_view_gui attribute=$node.object.data_map.title}
</div> <p>Last updated {$node.parent.object.published|l10n(datetime)}</p>
<div class="block">
{attribute_view_gui attribute=$node.object.data_map.body} </div>
{* Subpages *}
<td width="140" valign="top">
<ul>
<h2>Sections</h2>
<li><a href={$node.parent.url_alias|ezurl}>{$node.parent.name}</a></li>
{section name=Child loop=$children}
{section show=eq($Child:item.node_id, $node.node_id)}
<li>{$Child:item.name}</li>
{section-else}
<li><a href={$Child:item.url_alias|ezurl}>{$Child:item.name}</a></li> {/section}
{/section}
</ul> </td> First you create a Multipage Article and then create Multipage SubPages under the article. The subpages should then be listen when you view either the main article or one of the subpages. (note: you might want to change the html around the listing of subpages)
Senior Software Engineer - Vision with Technology
http://www.visionwt.com
http://www.omh.cc
http://www.twitter.com/omh
eZ Certified Developer
http://ez.no/certification/verify/358441
http://ez.no/certification/verify/272578
|