Wednesday 27 June 2007 11:18:45 pm
The 'news site' package was from the pre-website interface eZ Publish. If you have the Frontpage content class available it sounds like you are running the website interface. I think your best bet would be to try and override one of the templates in there (they are all in extensions folder) unless you can get one of the existing ones to do what you want. I'm pretty sure that one of those 'embedded templates', or whatever they call them, has very similar functionality to what you are looking for. If you do go down the template override road, a couple of tips: Work out what template you are looking at by using the Template debug and Inline template debug checkboxes in the admin interface. When you are trying to establish whether it is actually working I'd advise replacing the content of the template with "my template" in red h1 or something until you are sure the override is actually operational - a template can work the same as an SSI. Once you do get the override operating properly you'll find a heap of good examples here: http://ez.no/doc/ez_publish/technical_manual/3_9/reference/modules/content/fetch_functions/list Limiting the amount of text displayed can be done by using the 'shorten' operator. Here's an example of a template which does something along the lines of what you want. The '435' is the parent node - the node number of the folder the objects are in. The 'strip tags' stuff is because the field is XML and we don't want it chopping html tags in half when it gets to the 80 character limit. We also don't want it trying to include embedded images, which may look a bit ugly!
{*?template charset=utf-8?*}
{def $highlights=fetch( 'content', 'list',
hash( 'parent_node_id', '435',
'sort_by', array( 'priority', true() ),
'limit', '3'
))}
{foreach $highlights as $highlight}
<div class="bighighlight">
<div style="width:{$highlight.object.data_map.image.content.data_map.image.content[bighighlights].width}px">
{attribute_view_gui attribute=$highlight.object.data_map.image image_class=bighighlights}
</div>
<h2>{attribute_view_gui attribute=$highlight.data_map.title| shorten(12)}</h2>
{if $highlight.data_map.intro.has_content}
<p>{strip_tags( $highlight.data_map.intro.value.output.output_text ) | wash | shorten(80, '...', right)}
</p>
{/if}
<a href="{$highlight.object.main_node.url_alias}" title="more about {$highlight.data_map.title.content}">more »</a>
Paul Bolger
|