Differing Pagelayouts for different users

Author Message

James Packham

Thursday 02 October 2003 4:14:07 am

Hi

I want different users to have different "views" of my site. To do this I've started with a fairly simple example, using the news template site as a basis.

I have two versions of pagelayout.tpl, the original and a modified version where the menu items "login" and "register" appear on the left menu. I want anonymous users to see the modified template and logged in users to see the original. Here they are displayed in the news_admin interface:

Template Design Resource
/pagelayout.tpl design/news/templates
/anonpagelayout.tpl design/news/override/templates

I also have an entry in settings/siteaccess/override.ini.append
that reads:

[anon_user_view]
Source=/pagelayout.tpl
MatchFile=/anonpagelayout.tpl
Subdir=templates
Match[class]=10

(with 10 being the class of the anonymous user)

It doesn't seem to be working, have I gone about it the right way? I don't mind if no one can help me fix it, I just wanted to know if I'm doing this the wrong way...

~James~

Sandra Parente

Thursday 02 October 2003 6:31:13 am

You must specify the section, too:

Match[section]=4
Match[class]=10

So, before you have to assign to your content a different section for every different template.

It works for me.

Sandra Parente
www.netbliss.it

James Packham

Friday 03 October 2003 2:27:15 am

Hi

First of all thank you for your help! :) I wasn't sure if anyone was going to get back to me, so was very thankful and relieved to see that you had!

Second, I was reading a documentation about this after I read your post that was very helpful in taking me further, but I came in this morning and I can't remember what it was called (*doh!*)! Could you, or anyone else reading this help me out with finding it?

Cheers!

~James~

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 22:14:44
Script start
Timing: Jan 18 2025 22:14:44
Module start 'layout'
Timing: Jan 18 2025 22:14:44
Module start 'content'
Timing: Jan 18 2025 22:14:45
Module end 'content'
Timing: Jan 18 2025 22:14:45
Script end

Main resources:

Total runtime1.1799 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 589.1641152.6406
Module start 'layout' 0.00510.0030 741.804739.4766
Module start 'content' 0.00801.1707 781.2813544.9375
Module end 'content' 1.17870.0012 1,326.218812.1250
Script end 1.1799  1,338.3438 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.2555160.0002
Check MTime0.00130.1082160.0001
Mysql Total
Database connection0.00060.051010.0006
Mysqli_queries1.132495.9682570.0199
Looping result0.00050.0453550.0000
Template Total1.152797.720.5763
Template load0.00180.153120.0009
Template processing1.150897.534020.5754
Template load and register function0.00010.007210.0001
states
state_id_array0.00090.079810.0009
state_identifier_array0.00110.092720.0005
Override
Cache load0.00150.1291340.0000
Sytem overhead
Fetch class attribute can translate value0.00060.048920.0003
Fetch class attribute name0.00080.066750.0002
XML
Image XML parsing0.00200.170120.0010
class_abstraction
Instantiating content class attribute0.00000.000860.0000
General
dbfile0.00200.1707220.0001
String conversion0.00000.000640.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
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/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
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 19
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs