After overriding the pagelayout.tpl do we need to take care of anything

Author Message

Romeo Antony

Sunday 11 July 2010 6:24:35 am

I have overided pagelayout.tpl with pagelayout1.tpl

This is because I need to change the background color of each page that I access from topmenu(like contact us, sports, business->these are (frotpage class) that is the topmenu)

So after this do I need to take care of user login, logout or anything.

Can any one have any suggestions?

Neo Pixel

Sunday 11 July 2010 8:17:14 am

Hi Romeo,

Pagelayout is a universal template. So long as you associate css classes with each pagelayout and the relevant override entries you shouldn't have to do anything else.

ie

For the original you'd have div id="page" in the pagelayout.tpl

For the red background you'd have div id="page_bg_red" defined in the pagelayout.tpl and the css entry div#page_red { background-color:#ff0000; } in the stylesheet.

You can of course apply the same principal to the body tag.

Hope that helps

Asking stupid questions so you don't have to!

Romeo Antony

Sunday 11 July 2010 11:22:32 am

If I understand you correctly , when when I override pagelayout.tpl , I do not worry at all as long as include css classes with each pagelayout and the relevant override entries.

I have just copied the complete pagelayout.tpl to a new pagelayout1.tpl file and set the div class of

pagelayout.tpl as page and pagelayout1.tpl as page1

And applied different bg colors for page1 div class and page div class.So nothing to worry Neo.

Can u just confirm my statement for my trust

Thanks in advance Romeo

Kévin S.

Tuesday 13 July 2010 12:26:59 am

Hello !

Maybe I do not understand correctly what you want to do, but if you only need to have a frontpage (let's say "contact" ) with a red background, and another frontpage ("Business" ) with a green background, for instance, I think you don't even have to modify pagelayout.tpl...

There are two solutions I would prefer :

1. In frontpage.tpl (lets assume that your contact frontpage has 123 as node ID, and business has 124):

{if eq($node.node_id, 123)}
    <div class="page_red">
{else if eq($node.node_id, 124)}
    <div class="page_green">
{else}
    <div = "page_none">
{/if}
 ...
</div>

(check syntax)

2.If the structure of your red page is fondamentally different than the structure of your green page, you can also override the frontpage.tpl for each node. Example of the declaration in override.ini :

[frontpage_contact]
Source=node/view/full.tpl
MatchFile=frontpage_contact.tpl
Subdir=templates
Match[node]=123

(the same for business)

Don't forget to put this declaration before the default frontpage one, so its priority is the greatest of the two (otherwise your override will not be effective).

Romeo Antony

Friday 16 July 2010 8:15:04 am

Thank you for your idea .I will try this

Romeo

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 11:42:34
Script start
Timing: Jan 18 2025 11:42:34
Module start 'layout'
Timing: Jan 18 2025 11:42:34
Module start 'content'
Timing: Jan 18 2025 11:42:35
Module end 'content'
Timing: Jan 18 2025 11:42:35
Script end

Main resources:

Total runtime1.1803 sec
Peak memory usage4,096.0000 KB
Database Queries65

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0081 589.5234152.6875
Module start 'layout' 0.00820.0164 742.210939.5234
Module start 'content' 0.02451.1543 781.7344598.8281
Module end 'content' 1.17880.0014 1,380.562516.0781
Script end 1.1803  1,396.6406 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.3008160.0002
Check MTime0.00130.1087160.0001
Mysql Total
Database connection0.00080.069210.0008
Mysqli_queries1.109293.9748650.0171
Looping result0.00060.0530630.0000
Template Total1.129195.720.5646
Template load0.00220.186420.0011
Template processing1.126995.472320.5634
Template load and register function0.00010.010810.0001
states
state_id_array0.00080.066810.0008
state_identifier_array0.00080.065320.0004
Override
Cache load0.00200.1712390.0001
Sytem overhead
Fetch class attribute can translate value0.00090.074530.0003
Fetch class attribute name0.00170.146370.0002
XML
Image XML parsing0.00140.115630.0005
class_abstraction
Instantiating content class attribute0.00000.001790.0000
General
dbfile0.00130.1070230.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
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/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: 20
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs