Dynamic frontpage

Author Message

Carl Worswick

Friday 25 March 2005 6:47:43 am

Can someone please give me a few pointers on creating a dynamic fronpage?

Any information would be most welcome.

Gabriel Ambuehl

Friday 25 March 2005 8:04:36 am

Some more info on what you try to achieve wouldn't hurt...

Visit http://triligon.org

Carl Worswick

Friday 25 March 2005 8:16:38 am

Ok, perhaps I should give you a little more information about what I want to achieve.

I want a dynamic frontpage that updates each day with the latest stories that are being fetched from 5 or 6 different nodes. I want one main story, two secondery stories and a list of the latest articles - coming from the different nodes - running underneath them.

I have followed the tutorial without too much difficulty but of course the frontpage there is static and isn't what I want.

thanks and sorry for being so brief previously!

Daniel Guerrier

Friday 25 March 2005 10:47:53 am

Hello

I had a similar question.
I believe are trying to do the same thing
It took a little experimenting but you can select items from different nodes using a simple fetch.

Here's an example

{section loop=fetch( content,list, hash( parent_node_id,  60 ) ) }
{$:item.name|wash}
{/section}

This will select all items from node 60, loop thru and list the names. You will need to read the doc for all the option available in a fetch and the parameters you can provide using the hash.

You can then include this template into others using the include tag. That is how to create you dynamic homepage.

Frey Staso

Tuesday 29 March 2005 8:34:51 am

something that might help, you can sort your fetch so that it only includes things like, a specific class. For example, put

class_filter_type,include,class_filter_array,array(12)

into your fetch parameters

{section loop=fetch( content,list, hash( parent_node_id,  $node.node_id,class_filter_type,include,class_filter_array,array(12)
 ) ) }
{$:item.name|wash}
{/section}

and you SHOULD get just content objects that are of class 12 (in this case, files)

I'm sure there is one that is like "published date" too...

Carl Worswick

Tuesday 29 March 2005 2:49:18 pm

Thanks for all your replies, I am still a little confused about this. In my pagelayout.tpl file I have my header, menu, the piece of code generating the dynamic section {$module_result.content} and finally my footer.

Am I right in presuming that the piece of code allows me to create an override template which can create a dynamic frontpage?

Well, when I create an override - frontpage.tpl - it doesn't seem to work.

Can anyone clarify where I am getting lost here?

thanks

Carl Worswick

Tuesday 29 March 2005 3:09:36 pm

To add a bit of my frontpage.tpl code here is the first bit:

<B>{let news_list=fetch( content, tree, hash( parent_node_id, 143,
                                           limit, 3,
                                           sort_by, array( published, false() ),
                                           attribute_filter, array( array( 248, '=', '1' ) ),
                                            ) )}</B>

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