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.

eZ debug

Timing: Jan 19 2025 13:51:10
Script start
Timing: Jan 19 2025 13:51:10
Module start 'layout'
Timing: Jan 19 2025 13:51:10
Module start 'content'
Timing: Jan 19 2025 13:51:10
Module end 'content'
Timing: Jan 19 2025 13:51:10
Script end

Main resources:

Total runtime0.0155 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 589.0469152.6094
Module start 'layout' 0.00510.0033 741.656339.4141
Module start 'content' 0.00840.0050 781.070389.2891
Module end 'content' 0.01340.0021 870.359434.3047
Script end 0.0155  904.6641 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002415.3589140.0002
Check MTime0.00106.4190140.0001
Mysql Total
Database connection0.00085.416110.0008
Mysqli_queries0.002616.555030.0009
Looping result0.00000.154910.0000
Template Total0.001610.610.0016
Template load0.00095.525010.0009
Template processing0.00085.029710.0008
Override
Cache load0.00053.434910.0005
General
dbfile0.00031.952180.0000
String conversion0.00000.065940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs