Get the name of layout in node/view/full

Author Message

Jerome Despatis

Friday 09 July 2010 6:54:58 am

Hi,

I've done an override on a node/view/full, and in it, I'd like to get the name of the layout used.

For example, when I access my node with

 

/layout/set/dmvsimple/content/versionview/257/24/eng-GB

I'd like, in my override, to retrieve the 'dmvsimple'

In fact, thanks to show_variables(), dmvsimple is in Namespace: DesignKeys > used > layout

I've tried $DesignKeys:used.layout to get it, but it's always empty...

However $DesignKeys:used.layout works (it returns dmvsimple), when I invoke it from the pagelayout

=> Any idea how to get the layout name in a node/view/full override ?

Thanks for your help

Peter Keung

Friday 09 July 2010 7:11:03 am

If you're not directly in the full view template and are instead in an included or embedded template, you have to use the global namespace $#DesignKeys. If that's not the problem, you might be using an older version of eZ Publish that might have a bug in the eZ XML output handler.

http://www.mugo.ca
Mugo Web, eZ Partner in Vancouver, Canada

Jerome Despatis

Friday 09 July 2010 7:16:18 am

Yes thanks !

So good syntax was {$#DesignKeys:used.layout}

Thanks again

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 18 2025 05:08:39
Script start
Timing: Jan 18 2025 05:08:39
Module start 'layout'
Timing: Jan 18 2025 05:08:39
Module start 'content'
Timing: Jan 18 2025 05:08:40
Module end 'content'
Timing: Jan 18 2025 05:08:40
Script end

Main resources:

Total runtime0.7967 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.0062 588.0469152.6406
Module start 'layout' 0.00620.0032 740.687539.4766
Module start 'content' 0.00940.7859 780.1641532.0078
Module end 'content' 0.79530.0013 1,312.17198.2813
Script end 0.7966  1,320.4531 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4101160.0002
Check MTime0.00130.1660160.0001
Mysql Total
Database connection0.00090.117510.0009
Mysqli_queries0.743793.3500570.0130
Looping result0.00060.0729550.0000
Template Total0.758995.320.3795
Template load0.00250.316120.0013
Template processing0.756494.938520.3782
Template load and register function0.00020.027710.0002
states
state_id_array0.00100.119910.0010
state_identifier_array0.00210.267820.0011
Override
Cache load0.00210.2603210.0001
Sytem overhead
Fetch class attribute can translate value0.00060.069420.0003
Fetch class attribute name0.00180.232140.0005
XML
Image XML parsing0.00100.126920.0005
class_abstraction
Instantiating content class attribute0.00000.001240.0000
General
dbfile0.00170.2137170.0001
String conversion0.00000.001140.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/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
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: 5

Time used to render debug report: 0.0001 secs