How can I determine if it's home page

Author Message

Seb B

Thursday 10 June 2010 2:07:11 am

Hello,

I would like to know if it's possible to determine if the current page is homepage or not...
I want to display a tag "H1" around my logo only on the homepage...

thanks in advance,

Ivo Lukac

Thursday 10 June 2010 3:22:31 am

Assuming you are in pagelayout.tpl or some included template (ezwebin extension) and your homepage node id is 2, you can do:

{if $current_node_id|eq(2)}<h1>{/if} 
....
{if $current_node_id|eq(2)}</h1>{/if}

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Seb B

Thursday 10 June 2010 5:24:33 am

Thanks it works !

As you explain it, I can use it for a lot of things, great !

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 15 2025 09:14:07
Script start
Timing: Jan 15 2025 09:14:07
Module start 'layout'
Timing: Jan 15 2025 09:14:07
Module start 'content'
Timing: Jan 15 2025 09:14:09
Module end 'content'
Timing: Jan 15 2025 09:14:09
Script end

Main resources:

Total runtime1.6401 sec
Peak memory usage6,144.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0073 684.7188183.7031
Module start 'layout' 0.00730.0034 868.421952.5938
Module start 'content' 0.01061.6235 921.01561,794.9141
Module end 'content' 1.63410.0059 2,715.929764.5234
Script end 1.6400  2,780.4531 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.01000.6099160.0006
Check MTime0.00140.0829160.0001
Mysql Total
Database connection0.00090.056110.0009
Mysqli_queries1.580796.3828570.0277
Looping result0.00080.0476550.0000
Template Total1.592397.120.7961
Template load0.00450.275720.0023
Template processing1.587796.809520.7939
Template load and register function0.00170.101410.0017
states
state_id_array0.00260.158210.0026
state_identifier_array0.00150.091920.0008
Override
Cache load0.00390.2382140.0003
Sytem overhead
Fetch class attribute can translate value0.00110.070120.0006
Fetch class attribute name0.00210.126440.0005
XML
Image XML parsing0.00080.046920.0004
class_abstraction
Instantiating content class attribute0.00000.000740.0000
General
dbfile0.00190.1163170.0001
String conversion0.00000.000740.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
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.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: 12
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs