Paging

Author Message

thomas BAILLEUL

Thursday 02 November 2006 6:03:57 am

Hi,

I have built a site with several folders, but I can display all of them in the same page, so there are 2 links added with 2 others pages.
But I want just show all folders in the same main page(homepage web site in fact), displaying it in differents columns, so I need to create a navigation.tpl like google.tpl or simple.tpl,
I am on it but as I'm not a geek so if anyone have had ever to do that I woud be grateful if you could share your work!

Nabil Alimi

Thursday 02 November 2006 9:58:03 am

Hi Thomas,

You are probably using fetch( content , list ) to display your folders.
http://ez.no/doc/ez_publish/technical_manual/3_7/reference/modules/content/fetch_functions/list

If that's the case, you need to deal with the <b>offset</b> parameter of this function and ezpublish view_parameters system http://ez.no/doc/ez_publish/technical_manual/3_8/templates/basic_template_tasks.

A quick example :

{def $my_folders=fetch( content , list , hash( parent_node_id , 2 , offset , $view_parameters.offset , limit , 5 ) )}

{* Here you display your content *}

{* The navigator *}
<a href={concat( $the_path_you_need , '/(offset)/' , 6 )|ezurl}>1</a>
<a href={concat( $the_path_you_need , '/(offset)/' , 11 )|ezurl}>2</a>

So when you'll click on "5", this will display 5 elements from the fifth.

Hope it helped.

PS : You don't need to be a geek in order to deal with EzPublish. :-)

My blog : http://www.starnab.com/ezpublish / http://www.starnab.com/ / http://www.assiki-consulting.com
eZ Publish Freelance developper. Feel free to contact me +33 674 367 057
nabil at assiki d0t fr

thomas BAILLEUL

Friday 03 November 2006 3:52:19 am

Hi Nabil,

Thanks for your help, it helps me
but you don't really get it , I mean I want displaying all my folders in the same page divided into 3 columns I don't link for an other page with the next folders
I try following this link : http://ez.no/community/articles/building_a_custom_template_for_a_news_portal/main_override_template
I use the code above :

<width="100%">
<tr>
<td>
<ul>
{def $my_folders=fetch( content , list , hash( parent_node_id , 2 , offset ,
$view_parameters.offset , limit , 30)) }
{foreach $my_folders as $key => $folder max 30 offset 5}
<li>
{node_view_gui =small content_node=$folder}
</li>
{delimiter}
{if eq($key|mod(2),0)}
{/delimiter}
{/foreach}
</ul></td><td><ul>
{/if}
{/delimiter}
</ul>
</td>
</tr>
</table>
but it doesn't work.
I would be grateful for help!

Claudia Kosny

Tuesday 07 November 2006 10:35:38 am

Hi Thomas

You have a couple of errors in your template code that should have given you some error messages in your debug output. Next time check there first or if you did, post the error messages as well.

Anyhow, the example code in the file you linked to is something like this:

   {* Show the next nine small news articles *}
   <table width="100%">
   <tr>
     <td>
     <ul>
   {foreach $articles_array as $key => $article max 9 offset 5}
       <li>
       {node_view_gui view=small content_node=$article}
       </li>
       {delimiter}
       {if eq($key|mod(3),0)}
       </ul></td><td><ul>
       {/if}
       {/delimiter}
   {/foreach}
     </ul>
     </td>
   </tr>
   </table>

You want to show all folders so you need to take out the max and the offset from the foreach. Then replace the article array with your folder array and you are done.

If you compare that to the code you posted you can see that the nesting of the tags is not correct in your code. Also there is a losing delimiter tag to much.

If you still have problem, post again. But then explain what exactly is not working, i.e. what is the output of your code vs what you want to achieve.

Greetings from Luxembourg

Claudia

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 22:21:57
Script start
Timing: Jan 18 2025 22:21:57
Module start 'layout'
Timing: Jan 18 2025 22:21:57
Module start 'content'
Timing: Jan 18 2025 22:21:57
Module end 'content'
Timing: Jan 18 2025 22:21:57
Script end

Main resources:

Total runtime0.0233 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.0086 588.9141152.6094
Module start 'layout' 0.00860.0060 741.523439.3984
Module start 'content' 0.01460.0063 780.921993.3984
Module end 'content' 0.02090.0023 874.320334.3047
Script end 0.0232  908.6250 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.003012.6954140.0002
Check MTime0.00125.1208140.0001
Mysql Total
Database connection0.00187.540810.0018
Mysqli_queries0.006025.679830.0020
Looping result0.00000.129110.0000
Template Total0.00187.810.0018
Template load0.00093.761710.0009
Template processing0.00093.989210.0009
Override
Cache load0.00062.535810.0006
General
dbfile0.00156.414380.0002
String conversion0.00000.055340.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