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.

eZ debug

Timing: Jan 31 2025 06:12:22
Script start
Timing: Jan 31 2025 06:12:22
Module start 'layout'
Timing: Jan 31 2025 06:12:22
Module start 'content'
Timing: Jan 31 2025 06:12:22
Module end 'content'
Timing: Jan 31 2025 06:12:22
Script end

Main resources:

Total runtime0.0184 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0070 588.0313151.1953
Module start 'layout' 0.00700.0042 739.226636.6172
Module start 'content' 0.01120.0054 775.843894.2500
Module end 'content' 0.01660.0018 870.093837.9922
Script end 0.0184  908.0859 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002714.3731140.0002
Check MTime0.00126.3176140.0001
Mysql Total
Database connection0.00115.862510.0011
Mysqli_queries0.004826.086530.0016
Looping result0.00000.097010.0000
Template Total0.00157.910.0015
Template load0.00115.786210.0011
Template processing0.00042.115410.0004
Override
Cache load0.00063.411010.0006
General
dbfile0.00041.940880.0000
String conversion0.00000.053040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs