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