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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 19:26:59
Script start
Timing: Jan 18 2025 19:26:59
Module start 'layout'
Timing: Jan 18 2025 19:26:59
Module start 'content'
Timing: Jan 18 2025 19:26:59
Module end 'content'
Timing: Jan 18 2025 19:26:59
Script end

Main resources:

Total runtime0.6745 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 589.2891152.6563
Module start 'layout' 0.00610.0030 741.945339.5078
Module start 'content' 0.00910.6639 781.4531493.2031
Module end 'content' 0.67300.0014 1,274.65638.1094
Script end 0.6744  1,282.7656 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.5130160.0002
Check MTime0.00160.2343160.0001
Mysql Total
Database connection0.00100.154710.0010
Mysqli_queries0.630393.4539540.0117
Looping result0.00060.0843520.0000
Template Total0.642195.220.3210
Template load0.00210.310220.0010
Template processing0.640094.888820.3200
Template load and register function0.00020.024610.0002
states
state_id_array0.00110.157210.0011
state_identifier_array0.00120.181220.0006
Override
Cache load0.00170.2549240.0001
Sytem overhead
Fetch class attribute can translate value0.00070.106420.0004
Fetch class attribute name0.00180.268220.0009
XML
Image XML parsing0.00030.037220.0001
class_abstraction
Instantiating content class attribute0.00000.001020.0000
General
dbfile0.00060.0908100.0001
String conversion0.00000.001540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 16
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs