Folder - show three children per line with different css?

Author Message

Osichr Hayez

Wednesday 18 January 2006 6:48:51 am

In my folder object I display the children three per line. I would like to display a differet stylesheet for the three objects on each line.

First one should have class: childrenLeft
Second one should have class: childrenMid
Third one should have class: childrenRight

Fourth one (on the next line) should then again have class: childrenLeft
and so on..

How can I get this sorted?

This part of my full folder override template looks like this:
(just like the standard right-out-of-the-box template)

- - - - -
{set list_items=fetch_alias( children, hash( parent_node_id, $node.node_id,
					     offset, $view_parameters.offset,
					     sort_by, $node.sort_array,
					     class_filter_type, "include",
					     class_filter_array, array(2),
					     limit, $page_limit ) )}
{set list_count=fetch_alias( children_count, hash( parent_node_id, $node.node_id ) )}
{/section}

<div class="content-view-children">
{section var=child loop=$list_items sequence=array(bglight,bgdark)}
    {node_view_gui view=line content_node=$child}
{/section}
</div>

- - - - -

<i>ezpublish version 3.6.4</i>

Esteban Rodriguez

Wednesday 18 January 2006 7:19:58 am

I guess the simplest way would be to use the sequence parameter to have the loop alternate between the 3 classes you want

<div class="content-view-children">
{section var=child loop=$list_items sequence=array( ChildLeft , ChildMid , ChildRight )}
   <div class="$child.sequence">
      {node_view_gui view=line content_node=$child}
   </div>
{/section}
</div>

or maybe you could pass the value of $child.sequence as a parameter to the child's line template (and use it there to add a class to some existing div) to avoid cluttering your html with further markup.

hope it helps

I have great faith in fools; self-confidence my friends call it.

http://presencia.net

Osichr Hayez

Wednesday 18 January 2006 11:54:06 pm

Thanks to you my day started with a big smile! Now I understand what the sequence parameter is all about : )

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 01:14:58
Script start
Timing: Jan 31 2025 01:14:58
Module start 'layout'
Timing: Jan 31 2025 01:14:58
Module start 'content'
Timing: Jan 31 2025 01:14:59
Module end 'content'
Timing: Jan 31 2025 01:14:59
Script end

Main resources:

Total runtime1.1081 sec
Peak memory usage8,192.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 588.3750151.2422
Module start 'layout' 0.00640.0038 739.6172220.7500
Module start 'content' 0.01021.0970 960.36724,444.0547
Module end 'content' 1.10730.0008 5,404.421911.7813
Script end 1.1081  5,416.2031 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.3892160.0003
Check MTime0.00160.1411160.0001
Mysql Total
Database connection0.00110.095810.0011
Mysqli_queries1.016591.7255570.0178
Looping result0.00060.0530550.0000
Template Total1.048694.620.5243
Template load0.00360.323020.0018
Template processing1.045094.304520.5225
Template load and register function0.00140.128910.0014
states
state_id_array0.00270.247410.0027
state_identifier_array0.00150.133220.0007
Override
Cache load0.00310.2801220.0001
Sytem overhead
Fetch class attribute can translate value0.00200.177020.0010
Fetch class attribute name0.00180.160340.0004
XML
Image XML parsing0.00260.230620.0013
class_abstraction
Instantiating content class attribute0.00000.001040.0000
General
dbfile0.00590.5294160.0004
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 19
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs