Get parent module name

Author Message

Tony Stark

Wednesday 27 February 2008 9:12:36 am

Hi,

Can anyone explain if it is possible to get the name of the parent folders name? i.e. if you am viewing an item within a folder can I output the name of the folder it belongs to?

so if I have topnode > folder > item

can I output "folder" within the template used for "item"?

Thanks

Tony

Mark Marsiglio

Wednesday 27 February 2008 9:27:47 am

Yes - that is actually stored as an attribute of the current node. You can see all of the attributes by adding

 {$node|attribute(show,2)} 

in your template, where node is your variable, and 2 is the number of levels of depth to go into the object arrays. Increasing it will give you more options, but may kill your server depending on how powerful it is (cause an error). The list can get long quick.

You can also steal code from the breadcrumb nav template in ezwebin to get this info (it uses a different method, using the path array).

http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions

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 31 2025 00:22:34
Script start
Timing: Jan 31 2025 00:22:34
Module start 'layout'
Timing: Jan 31 2025 00:22:34
Module start 'content'
Timing: Jan 31 2025 00:22:34
Module end 'content'
Timing: Jan 31 2025 00:22:34
Script end

Main resources:

Total runtime0.6607 sec
Peak memory usage8,192.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 588.0234151.1953
Module start 'layout' 0.00520.0033 739.2188220.6563
Module start 'content' 0.00860.6514 959.87504,429.2344
Module end 'content' 0.66000.0006 5,389.10948.0313
Script end 0.6606  5,397.1406 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.5002160.0002
Check MTime0.00120.1838160.0001
Mysql Total
Database connection0.00090.139110.0009
Mysqli_queries0.575287.0724540.0107
Looping result0.00040.0560520.0000
Template Total0.600590.920.3003
Template load0.00210.321020.0011
Template processing0.598490.579120.2992
Template load and register function0.00140.216910.0014
states
state_id_array0.00200.297210.0020
state_identifier_array0.00090.134520.0004
Override
Cache load0.00180.2665150.0001
Sytem overhead
Fetch class attribute can translate value0.00150.224320.0007
Fetch class attribute name0.00160.242030.0005
XML
Image XML parsing0.00180.267520.0009
class_abstraction
Instantiating content class attribute0.00000.001230.0000
General
dbfile0.00981.4792150.0007
String conversion0.00000.000640.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
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/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: 9
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs