Custom tag to display child nodes

Author Message

Bruce Morrison

Sunday 07 March 2004 7:31:29 pm

I've created a custom tag to display a nodes children in an XML field. I wondering if this is a good idea or the best way of doing this.

I realise that this could be accomplished using the object tag but that would require that each child is added individually. Also the list would not be updated if children were added or removed.

Interested in comments.

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Balazs Halasy

Monday 08 March 2004 12:40:42 am

Hmm,

What is it that you wish to accomplish/do? I usually just add an additional boolean attribute to the class which says "Show children" - then I make sure that the template code checks this and that it displays the children (in a desired fashion) if the attribute is true (the checkbox is checked). Not sure if this is helps or not...

Balazs

Bruce Morrison

Monday 08 March 2004 3:18:14 pm

Hi Balazs,

I'm tring to give the content editor more control over the content. If I have a content type that has a title and a xml text field, then this custom tag would allow them to place a list of the current nodes children within the text. Because it is in a XML text field it can be placed anywhere within the content and given context.

If you add a "show children" attribute that shows the child objects then they are displyed in a static fashion, controled by the template. This also needs to be added to each content type, where as having a custom tag works across all content types (that contain an XML text field).

I guess I'm looking at the cleanest way of doing this.

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

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 06:17:14
Script start
Timing: Jan 19 2025 06:17:14
Module start 'layout'
Timing: Jan 19 2025 06:17:14
Module start 'content'
Timing: Jan 19 2025 06:17:14
Module end 'content'
Timing: Jan 19 2025 06:17:14
Script end

Main resources:

Total runtime0.7803 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0049 590.2969152.6250
Module start 'layout' 0.00490.0026 742.921939.4609
Module start 'content' 0.00750.7715 782.3828544.4375
Module end 'content' 0.77900.0013 1,326.820312.1563
Script end 0.7803  1,338.9766 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00280.3618160.0002
Check MTime0.00120.1540160.0001
Mysql Total
Database connection0.00080.101610.0008
Mysqli_queries0.727093.1653570.0128
Looping result0.00050.0646550.0000
Template Total0.753096.520.3765
Template load0.00230.299520.0012
Template processing0.750796.203020.3753
Template load and register function0.00010.012810.0001
states
state_id_array0.00090.111010.0009
state_identifier_array0.00130.161020.0006
Override
Cache load0.00190.2374220.0001
Sytem overhead
Fetch class attribute can translate value0.00140.178420.0007
Fetch class attribute name0.00100.127950.0002
XML
Image XML parsing0.00110.146720.0006
class_abstraction
Instantiating content class attribute0.00000.001760.0000
General
dbfile0.00180.2353220.0001
String conversion0.00000.000940.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/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs