Path

ez.no / ezpublish / documentation / building an ez publish site / the news page / full display of an article


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".

  1. Bring up the administration interface.
  2. Click on the "Design" tab.
  3. Click on "Templates" (in the menu on the left hand side).
    A list of template files will appear.
  4. Locate "/node/view/full.tpl" and click on it.
  5. Click "New override" to create a new template.
  6. Type in "full_view_news_article" into the "Filename" field.
  7. Set the "Class" dropdown box to "Article".
  8. Set the "Selection" dropdown box to "News section".
  9. Do not enter anything into the node field (leave it blank).
  10. In the "Base template on" section, select "Empty file".
  11. Click "OK".

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

The file should be like this, the </div> at the end.:

{* 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

As Faust Gertz says, this happens for me as well. I have tried to remove the <div> tag but I guess I am not doing this correctly either as I am not able to get it to show correctly. :-)
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?

Again, for ezPublish 3.5.0/Firefox 1.0 I had to remove '<div class="imageright">' and it's closing '</div>'. Is this <div> being generated by embed_image.tpl?

Typo in Article full view XHTML

The word 'imagel' should be simply 'image'.

Contents

Building an eZ publish site

Prerequisits
Situation
Creating the TSCM site
Testing the interfaces
Setting up the main layout
Creating sections
The welcome page
The news page
    Adding news articles
    Assigning the News folder to the News...
    Overview of the latest news
    Full display of an article
    News archive
The members page
The guestbook
The links page


Created

22/10/2003
4:33:26 pm
by Balazs Halasy

Last updated

10/12/2004
12:39:10 pm
by Frederik Holljen

Authors

Balazs Halasy
Raymond Bosman
Frederik Holljen



This page is part of the eZ Publish documentation. The documentation is available under the GNU Free Documentation License. All contributions will be released under the terms of this license.