Forums / Setup & design / How do I include multiple articles in layout template?

How do I include multiple articles in layout template?

Author Message

Aaron Weiss

Wednesday 24 March 2004 4:03:58 pm

Advanced apologies if I'm missing something really obvious. Just starting to learn EZ and have been reading the documentation. Suppose I have built a small site that contains five articles. I am trying to create a layout template that can arrange all five articles on a single page. Let's say I want the layout like this (and I already built the HTML structure):

article1 --- article2
------article 3------
article4 --- article5

I am unclear how, in the template language, I specify to "include" the article (i.e. content/view/full/72 for article1, content/view/full/73 for article2, etc.). First I was trying to rip apart the objects for these articles and spitting out their attributes, but there must be an easier way. The "include" function seems to be for including actual files, as opposed to articles stored inside the EZ system. Help?? Even just a pointer like "hey idiot -- read this..." would be great.

thanks!
Aaron

Lazaro Ferreira

Wednesday 24 March 2004 4:45:03 pm

Hi,

You can only have one article via module_result.content
The other four, you will need to fetch it explicitly using fetch() function, something like :

{* Fetch node number 42. i.e: article2 *}
{let node=fetch( 'content', 'node', hash( 'node_id', 42 ) )}

{* Display the full article2. *}
{node_view_gui view=full content_node=$node
{$node.name}

{/let}

Replace in the code above the node_id for your actual node_id, open the article in the admin page it will show its node_id
You can repeat this block of code for every other article you want to include in your layout page

After that, you may need to override the default "full article" template and customize it to your needs

Lazaro
http://www.mzbusiness.com