Creating user "views" with sections

Author Message

James Packham

Monday 06 October 2003 3:27:27 am

Hi

I know I've posted asking about this before, but I'm still struggling :( I want to create different pagelayout templates for different classes of users who log onto my website.

So far I've got my two templates - pagelayout.tpl and pagelayout_section_5.tpl (the second being an override for anonymous users).

In my ~path to settings for my site~/override.ini.append I have this entry on the end:

[anon_user_view]
Source=/pagelayout.tpl
MatchFile=/pagelayout_section_5.tpl
Subdir=templates
Match[class]=10
Match[section]=5

I also went into the admin site and created a section (id 5) that is assigned to the root of my site (I called this section "not logged in section" ).

However it doesn't seem to be working... I think I might have missunderstood some of the documentation (although I can't see where) or some of the advice I've been given, so if anyone could offer any help or alternative methods I'd be very grateful :)
Thanks in advance!

~James~

Shaun Ellis

Monday 06 October 2003 6:33:42 am

James,
What do you mean by "it's not working"? What's happening? Why would you expect pagelayout.tpl to be used if a user is logged in?
If you're more descriptive, maybe I can help you.

-Shaun

Sandra Parente

Monday 06 October 2003 7:02:40 am

There is another thing you must check, that is the role of the user "anonymous": if it hasn't the right to see also the section you created, of course your changes are not working properly.
Remember also to delete manually the cache files you have in your eZpublish installation, since there is a bug on the last 3.2 for cache clearing (template and ini) from admin interface.

Sandra Parente
www.netbliss.it

James Packham

Monday 06 October 2003 7:09:40 am

Ok, sorry about that. Let me start from the start because I'm not very good at explaining these things :)

I'm trying to create different versions of my site for different different classes of user viewing the it. For example I want logged in users to be able to download reports (pdfs), take part in forums and that kind of thing, whilst anonymous users will only have more limited access, such as able to read overviews of reports, view forums and news.

To do this I've been lead to believe that I have to use different templates that allow users to do different things in conjunction with the roles and create an entry in my override.ini.append file such as above.

I've also been told that I have to create different sections for each user, so that eZ knows what to allow the users access to (the sections bit is where it all starts to get 'fuzzy').

Since my last post I've made some progress after reading this post http://www.ez.no/developer/ez_publish_3/forum/setup_design/login_box . I can now get eZ to tell whether someone is logged in and who they are. I can also make it relay this information so that it appears in the users browser and prompts them to login or logout (depending on which they have already done).

I should stress that I've only just managed to do this, so haven't found a way manipulate this newly discovered feature further.

I think if you could just lend me the benefit of your experience then it would be a tremendous help! I think the most important thing I would like to know right now is "Am I going about this the right way?"

Thanks for your help - really appreciated!

~James~

James Packham

Monday 06 October 2003 7:13:18 am

Sandra, I've disabled template caching in my site.ini and cleared my cache already because it makes changing templates a bit easier, will this be ok? Or do I still need to manually clear everytime?

Sandra Parente

Monday 06 October 2003 8:04:22 am

If you already disabled template caching, remember only to clear manually the .ini cache, since you changed the override.ini file in settings.

I created a simple portal where anonymous and logged in users see and do different things, only using roles management. I created sections that anonymous users cannot read, and in this sections I have activated forums, shopping area, etc.
When you open the site, anonymous see a menu with general infos, but when you log in, the menu populates with other links for intranet activities. I did not need to make a different pagelayout for this...

Sandra Parente
www.netbliss.it

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