Detect used layout from node view

Author Message

Marko Žmak

Saturday 28 February 2009 7:37:33 am

Is there a way to detect from node view template which layout is used?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Marko Žmak

Sunday 10 January 2010 6:14:32 am

I fond the sollution to this one, its $DesignKeys:used.layout variable. Just a notice, this variable is not always set, so it should be used like in this example:

{if is_set($DesignKeys:used.layout)}
    {def $layout=$DesignKeys:used.layout}
{else}
    {def $layout=false()}
{/if}

It works both in pagelayout and in node view.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

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 03:39:02
Script start
Timing: Jan 31 2025 03:39:02
Module start 'layout'
Timing: Jan 31 2025 03:39:02
Module start 'content'
Timing: Jan 31 2025 03:39:02
Module end 'content'
Timing: Jan 31 2025 03:39:02
Script end

Main resources:

Total runtime0.0227 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 588.1563151.2109
Module start 'layout' 0.00550.0033 739.3672220.6875
Module start 'content' 0.00880.0126 960.0547997.9297
Module end 'content' 0.02140.0013 1,957.984429.9922
Script end 0.0227  1,987.9766 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002511.0647140.0002
Check MTime0.00104.5644140.0001
Mysql Total
Database connection0.00104.335610.0010
Mysqli_queries0.00229.682830.0007
Looping result0.00000.044110.0000
Template Total0.00094.010.0009
Template load0.00073.133210.0007
Template processing0.00020.880410.0002
Override
Cache load0.00052.160510.0005
General
dbfile0.00167.072280.0002
String conversion0.00000.030440.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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