Forums / Setup & design / Sorting nodes and subnodes in alphabetical order

"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".

Sorting nodes and subnodes in alphabetical order

Author Message

Piotr Kwiatkowski

Wednesday 26 May 2004 11:04:44 pm

I have got node structure like this:

AFolder1
----- ACategory
----- BCategory
BFolder2
----- ACategory
----- BCategory

I want to display them in that order I present, so the Categories are in the top level and subcategories are specified categorie. Categories and subcategories must be in alphabetical order.

I have done sth like this:

{let children=fetch('content', 'tree', hash(parent_node_id,$node.node_id,
		                        sort_by,$node.sort_array,
			                offset,$view_parameters.offset))}

{section name=Child loop=$children}
    {node_view_gui view=line content_node=$Child:item}
{/section}

But this only present categories and subcategories in alphabetical order without structure I present at the beginning.

I know how to do this using 2 section and 2 let definitions. But I want to this in one {section} and {let} definition.

Thank for help.

Best regards.