ez.no / ezpublish / documentation / building an ez publish site / the news page / full display of an article
These documentation pages are no longer maintained. Please visit the new documentation site.
The news overview that we created in the previous section displays a list of the seven most recent articles that are stored inside the news folder. However, the page only shows a small fragment of the articles. The entire contents of an article can be accessed by clicking its headline or image. These are links to the full view of the article. When accessed, you should be able to see something like this:
What you're looking at is the standard template that eZ publish uses to display the full contents of an article object. The standard template is rather boring. We should really use a custom template instead. The following text explains how to generate a custom full-view-template for the "Article" content class within the "News section".
This will generate an empty file ("design/tscm/override/templates/full_view_news_article.tpl") and instruct eZ publish to use it every time an article that resides in the "News section" is viewed. Put the following lines into the newly generated file, raise priority, and flush the cache:
{* Display the headline, use huge characters. *} <div class="headline"> {attribute_view_gui attribute=$node.object.data_map.title} </div> {* Display the thumbnail image, right-justified. *} <div class="imageright"> {attribute_view_gui attribute=$node.object.data_map.image} </div> {* Display the intro-text using bold characters. *} <b> {attribute_view_gui attribute=$node.object.data_map.intro} </b> {* Display the actual body/content of the article. *} {attribute_view_gui attribute=$node.object.data_map.body}
This code will take care of displaying an article in a nice way. Try to access one of the articles from within the "Latest News" page (by clicking on either a headline or an image). You should be presented with something like this:
Comments
Solution
Clemens Timmermans
Wednesday 09 February 2005 1:52:15 pm
{* Display the headline, use huge characters. *}
<div class="headline">
{attribute_view_gui attribute=$node.object.data_map.title}
</div>
{* Display the thumbnail image, right-justified. *}
<div class="imageright">
{attribute_view_gui attribute=$node.object.data_map.image}
...
{* Display the actual body/content of the article. *}
{attribute_view_gui attribute=$node.object.data_map.body}
</div>
Image floated at right
Erik Thorsen
Sunday 09 January 2005 12:53:37 pm
Could anyone post an update/correction on how to fix this. It also happens in IE and Firefox as Faust Gertz points out.
Thank you!
Image floated right?
Faust Gertz
Tuesday 28 December 2004 10:49:12 pm
Typo in Article full view XHTML
Dave Myron
Friday 10 December 2004 11:30:16 am