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

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

eZ debug

Timing: Jan 18 2025 10:43:11
Script start
Timing: Jan 18 2025 10:43:11
Module start 'content'
Timing: Jan 18 2025 10:43:12
Module end 'content'
Timing: Jan 18 2025 10:43:12
Script end

Main resources:

Total runtime1.1204 sec
Peak memory usage4,096.0000 KB
Database Queries202

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0093 589.2031180.7969
Module start 'content' 0.00930.9572 770.0000603.9531
Module end 'content' 0.96640.1539 1,373.9531337.3516
Script end 1.1203  1,711.3047 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.3850210.0002
Check MTime0.00150.1307210.0001
Mysql Total
Database connection0.00160.142610.0016
Mysqli_queries1.030892.00422020.0051
Looping result0.00220.20032000.0000
Template Total1.082996.720.5414
Template load0.00220.195220.0011
Template processing1.080796.454020.5403
Template load and register function0.00010.010310.0001
states
state_id_array0.00090.081410.0009
state_identifier_array0.00330.293620.0016
Override
Cache load0.00180.1592390.0000
Sytem overhead
Fetch class attribute can translate value0.00190.169640.0005
Fetch class attribute name0.00100.087070.0001
XML
Image XML parsing0.00180.164940.0005
class_abstraction
Instantiating content class attribute0.00000.001490.0000
General
dbfile0.00420.3784340.0001
String conversion0.00000.000530.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 20
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs