Forums / General / How to limit foreach loop

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

How to limit foreach loop

Author Message

Stéphane Bullier

Thursday 15 September 2005 7:25:20 am

Hello,

How to limit a fetch tree like that :

{section name=random loop=$randomised_array max=2}

with shuffle extension; I can't use limit because I want fetch all the node of my folder :

{def $cas_client=fetch( 'content', 'tree', 
	                hash( 'parent_node_id', 84,
	                      'class_filter_type',  'include',
                              'class_filter_array', array( 'cas_client') ) )|shuffle}
	
{foreach $cas_client as $cas_clients}
{node_view_gui view='line' content_node=$cas_clients}
{/foreach}

Thank you. Best regards.

Stéphane

Kristof Coomans

Thursday 15 September 2005 11:00:46 pm

{foreach $cas_client as $cas_clients max 2}
...
{/foreach}

See http://ez.no/doc/ez_publish/technical_manual/3_6/reference/template_control_structures/looping/foreach .

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Stéphane Bullier

Friday 16 September 2005 12:56:46 am

Hello Kristof,

Thank you for your answer.

Bye

Stéphane