Sections: Help ME!!!

Author Message

hugo esparza

Thursday 16 March 2006 11:34:21 am

1) How is obtained the ID of a section, from templates? I need that if templates is a section X it makes something different that the others.

2) Also I need to redirigir towards a screen deprived according to the Role of the user, is possible this?

Thanks beforehand
:) Excuse my ingles

Ɓukasz Serwatka

Thursday 16 March 2006 11:30:30 pm

Ad.1)
In pagelayout you can use {$DesignKeys:used.section}. In full view you can use {$node.object.section_id}

Ad.2)
Not sure what you mean here, but you can check user role and do some action.

{def $current_user=fetch( 'user', 'current_user' )}

Then check:

{$current_user.roles|attribute}

More about ezrole objects
http://ez.no/doc_hidden/ez_publish/technical_manual/3_6/reference/objects/ezrole

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

hugo esparza

Friday 17 March 2006 12:13:10 pm

thanks Lukasz.

The first part I work myself without problems, but second no, so having the idea I did the following thing:

{let user=fetch( 'user', 'current_user' )}
	{let rol_usuario=$user.role_id_list|implode(', ')}
	{section show=eq($rol_usuario,'9')}
			<a href={"A"|ezurl}>
	{/section}
	{section show=eq($rol_usuario,'11')}
			<a href={"B"|ezurl}>
	{/section}
	{section show=eq($rol_usuario,'13')}
			<a href={"C"|ezurl}>
	{/section}
  {/let}
{/let}

Not this very pretty the code, but I work myself what wanted to do

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 19:34:49
Script start
Timing: Jan 18 2025 19:34:49
Module start 'layout'
Timing: Jan 18 2025 19:34:49
Module start 'content'
Timing: Jan 18 2025 19:34:49
Module end 'content'
Timing: Jan 18 2025 19:34:49
Script end

Main resources:

Total runtime0.0168 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.0067 589.2422152.6094
Module start 'layout' 0.00670.0028 741.851639.4141
Module start 'content' 0.00960.0050 781.265689.4297
Module end 'content' 0.01450.0022 870.695334.3047
Script end 0.0168  905.0000 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002816.7293140.0002
Check MTime0.00116.7765140.0001
Mysql Total
Database connection0.00137.695410.0013
Mysqli_queries0.002413.988330.0008
Looping result0.00000.195710.0000
Template Total0.001810.810.0018
Template load0.00106.006610.0010
Template processing0.00084.798410.0008
Override
Cache load0.00063.854110.0006
General
dbfile0.00031.788180.0000
String conversion0.00000.052540.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