Forums / Developer / Custom tag to display child nodes

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

eZ debug

Timing: Jan 31 2025 10:16:44
Script start
Timing: Jan 31 2025 10:16:44
Module start 'content'
Timing: Jan 31 2025 10:16:44
Module end 'content'
Timing: Jan 31 2025 10:16:44
Script end

Main resources:

Total runtime0.0133 sec
Peak memory usage2,048.0000 KB
Database Queries4

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 588.1563180.8281
Module start 'content' 0.00640.0035 768.984497.8828
Module end 'content' 0.00990.0034 866.867274.7031
Script end 0.0133  941.5703 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002216.2388120.0002
Check MTime0.00107.7282120.0001
Mysql Total
Database connection0.00064.649110.0006
Mysqli_queries0.003828.729040.0010
Looping result0.00000.098520.0000
Template Total0.003123.110.0031
Template load0.00075.234510.0007
Template processing0.002417.878610.0024
Override
Cache load0.00053.890110.0005
General
dbfile0.00032.0408100.0000
String conversion0.00000.053730.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs