change the pagelayout

Author Message

jb bianchi

Wednesday 03 August 2005 6:50:23 am

hello,

I don't know how i can do it so if you can help me i'll be great.
For my web there are 3 people: anonymous, editor ans admin.
I would like to have 3 first page for these 3 people. For example, if a anonymous go on my web , he see a page with just a input search.
If an editor go on the web site, he connects and he can see the input search and toolbar.

I know that i have to do it in the pagelayout.tpl in playing on the role. can you tell me a little more on it.

thank's

Arran Price

Wednesday 03 August 2005 4:32:12 pm

Hi,
depends on how different you want the pages to be I suppose. You could create 3 different pages and then have pagelayout.tpl import the appropriate one based on the user.
Or you could have one template and hide/show parts dependant on the user. You need to consider that just not showing the links to content dosent prevent access to it - you will need to make sure your roles etc provide that security if you require it.

Heres a sample bit of code which we use to show the login/logout button dependant on wether the user is recognised or just anonymous - which may be useful.

            {let current_user=fetch('user','current_user')}
               {section show=$current_user.login|eq('anonymous')}
                  <li> <a href="/index.php/intranet/user/login"> <image src={"/images/top_nav/icon_log_on.gif"|ezdesign} border="0"> log on</a> </li>
               {section-else}
                  <li> <a href="/index.php/intranet/user/logout"> <image src={"/images/top_nav/icon_log_out.gif"|ezdesign} border="0"> log out</a> </li>
               {/section}
           {let}

Hope that helps

Arran

jb bianchi

Thursday 04 August 2005 6:34:34 am

hy,

Thank's for the answer but now i want to know the user 's group of an personn.
How can do it?
it is a fetch too?

thank's.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.