Sort children by class

Author Message

Franck T.

Monday 03 October 2005 8:09:02 am

Hello,
I have this structure (with classes created to fit my needs):

-Department
-- Employee John
-- Employee Suzan
-- Employee Richard
--- Service A
--- Service C
--- Service B

I'd like to create a new full view of my class Department (id 29), where employees (id 30) and services (id 31) would be sorted and separated by a line <hr>, like this:

-Department
-- Employee John
-- Employee Richard
-- Employee Suzan
<hr />
--- Service A
--- Service B
--- Service C

I've tried with <b>class_identifier</b> but it doesn't work.
Thanks in advance for your help.

Kristof Coomans

Monday 03 October 2005 10:43:10 am

Can you post the code you've tried to use?

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

Franck T.

Tuesday 04 October 2005 12:12:41 am

Hello Kristof.
This was my original full view:

{let children=fetch( content, list, hash( parent_node_id, $node.node_id,
                                          sort_by,        $node.sort_array ))}

    <table class="in_departement">
        {section name=Child loop=$children}
            <tr>
                <td>
                    <a href={$:item.url_alias|ezurl}>{$:item.name}</a> 
                </td>
           </tr>
        {/section}
    </table>

{/let}

I turn it into this:

{let children=fetch( content, list, hash( parent_node_id, $node.node_id,
                                          sort_by,        $node.sort_array ))}
										  
	<table class="employees">
		{section var=emp loop=$children}
			{section show=$emp.class_identifier | eq('Employee')}
				<tr>
					<td>
						<a href= {$emp.url_alias|ezurl}> {$emp.name|wash} </a>
					</td>
				</tr>
			{/section}
		{/section}
	</table>	
	<hr />
	<table class="services">
		{section var=serv loop=$children}
			{section show=$serv.class_identifier | eq('Service')}
				<tr>
					<td>
						<a href= {$serv.url_alias|ezurl}> {$serv.name|wash} </a>
					</td>
				</tr>
			{/section}
		{/section}
	</table>	
	
									  
{/let}

... but it return nothing !

Franck T.

Wednesday 05 October 2005 11:30:26 pm

No idea? Really...?

Kristof Coomans

Thursday 06 October 2005 7:07:05 am

All characters of a class identifier are lowercase. Your check however assumes that the first character is uppercase.

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

Franck T.

Thursday 06 October 2005 12:11:42 pm

Arrrghh...What I call a killing detail !!
Thanks Kristof. You're simply the best !

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 19 2025 00:35:50
Script start
Timing: Jan 19 2025 00:35:50
Module start 'layout'
Timing: Jan 19 2025 00:35:50
Module start 'content'
Timing: Jan 19 2025 00:35:51
Module end 'content'
Timing: Jan 19 2025 00:35:51
Script end

Main resources:

Total runtime0.7102 sec
Peak memory usage4,096.0000 KB
Database Queries66

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0067 587.8047152.6094
Module start 'layout' 0.00680.0031 740.414139.4141
Module start 'content' 0.00980.6989 779.8281572.1172
Module end 'content' 0.70870.0014 1,351.945316.1875
Script end 0.7101  1,368.1328 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.5695160.0003
Check MTime0.00160.2292160.0001
Mysql Total
Database connection0.00080.115210.0008
Mysqli_queries0.658092.6539660.0100
Looping result0.00050.0735640.0000
Template Total0.674094.920.3370
Template load0.00210.293720.0010
Template processing0.671994.616920.3360
Template load and register function0.00010.017710.0001
states
state_id_array0.00210.290610.0021
state_identifier_array0.00130.185620.0007
Override
Cache load0.00180.2547410.0000
Sytem overhead
Fetch class attribute can translate value0.00090.128020.0005
Fetch class attribute name0.00080.107070.0001
XML
Image XML parsing0.00050.074120.0003
class_abstraction
Instantiating content class attribute0.00000.001780.0000
General
dbfile0.00080.1090160.0000
String conversion0.00000.001340.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
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 29
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs