Forums / Developer / Sections: Help ME!!!
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 objectshttp://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
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