dynamic content from more than one location

Author Message

Ole Kristian Klevstrand

Wednesday 18 February 2004 3:32:42 pm

Hi!

I have gone through the "Building an eZ publish site" documentation, and I am very confused. The example uses $module_result.content to put dynamic content into the pagelayout.tpl template.But what if I want to display content from two (or more) different nodes?

Thanks,

Ole Kristian

Björn Dieding@xrow.de

Thursday 19 February 2004 12:04:11 am

Impossible... because

content/view/full/node_id

has only one node as parameter

If you want to archive this for some reason your are looking into a lot of work

the result is the content in $module_result.content

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

Anne A

Thursday 19 February 2004 12:50:12 am

How is it possible to get several sections with dymaic content on a page?

Paul Forsyth

Thursday 19 February 2004 1:07:51 am

You can display content from other nodes if you want to. Simply fetch a node by id and display its data_map as you wish.

Paul

Ole Kristian Klevstrand

Friday 20 February 2004 1:41:21 am

Paul, I seem to be missing something basic here...can you give an example? I want to have one table (main content) with the latest five articles from the folder "myfrontpage" with subject and introduction, and one table with a list of the latest 10 subjects from the folder "news". Both "sections" should be displayed on the frontpage.

If I don't use $module_result.content, how do I link to the main content of my choice?

- Ole Kristian

Paul Forsyth

Friday 20 February 2004 2:04:53 am

You should always use $module_result.content on your main pagelayout. This pulls in the content from the location the user is currently viewing.

Instead what you need to do is modify the template for the content object that produces the code for $module_result.content. Remember, this is what each folder, article, etc does.

Take a look at this documentation page:

http://ez.no/ez_publish/documentation/building_an_ez_publish_site/the_news_page/overview_of_the_latest_news

and at the code halfway down. The fetch statement pulls in articles from a location and the loop underneath displays each using node_view_gui. If you have a different location for your new you would replace the $node.node_id with the appropriate value.

btw, in theory it is possible to code *everything* in the main pagelayout, but the template override system allows the developer to create many more types of sites.

Hope this helps

Paul

Ole Kristian Klevstrand

Sunday 22 February 2004 5:42:35 am

Thanks, think I got it now. :)

- Ole Kristian

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