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

eZ debug

Timing: Jan 18 2025 16:09:25
Script start
Timing: Jan 18 2025 16:09:25
Module start 'content'
Timing: Jan 18 2025 16:09:27
Module end 'content'
Timing: Jan 18 2025 16:09:27
Script end

Main resources:

Total runtime1.5227 sec
Peak memory usage4,096.0000 KB
Database Queries191

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 593.6016180.8125
Module start 'content' 0.00641.3317 774.4141498.3125
Module end 'content' 1.33810.1846 1,272.7266333.4531
Script end 1.5227  1,606.1797 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00420.2743210.0002
Check MTime0.00150.1001210.0001
Mysql Total
Database connection0.00070.048810.0007
Mysqli_queries1.453895.47001910.0076
Looping result0.00210.13551890.0000
Template Total1.487297.720.7436
Template load0.00210.135820.0010
Template processing1.485197.528920.7426
Template load and register function0.00030.018010.0003
states
state_id_array0.00120.077210.0012
state_identifier_array0.00320.210820.0016
Override
Cache load0.00170.1094240.0001
Sytem overhead
Fetch class attribute can translate value0.00140.094530.0005
Fetch class attribute name0.00130.085620.0007
XML
Image XML parsing0.00050.033930.0002
class_abstraction
Instantiating content class attribute0.00000.000420.0000
General
dbfile0.00370.2425210.0002
String conversion0.00000.000530.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 16
 Number of unique templates used: 5

Time used to render debug report: 0.0002 secs