[CPS-devel] Re: Displaying portlets *only* on the / page

bruno desthuilliers bruno at modulix.org
Thu Jan 12 18:08:43 CET 2006


Olivier Grisel wrote:
> bruno desthuilliers a écrit :
> 
>> Hi y'all
>>
>> We'd need to have some portlets that only show up on the 'root' page
>> ('/') of a CPS instance. Whatever combination of portlet
>> visibility/templeet visibility/theme page we tried so far, we still have
>> these portlets showing up in the directories views etc - in anything
>> that is not a section or a workspace in fact.
>>
>> Any hint ?
>>
>> (NB : CPS 3.3.6)
>>
>> TIA
> 
> 
> On a recent cps, this is achieved with the portlet guard set to "python:
> published == 'index_html'". However,I don't think the guards are
> available in 3.3.6.

Nope.

> What you could do is use a similar trick with several theme pages and a
> .cpsskins_theme python script at CPS root level with the following:
> 
> """
> ##parameters=REQUEST=None
> theme_id = 'my_theme_id'
> 
> if REQUEST is None:
>     REQUEST = context.REQUEST
> 
> is_home = REQUEST.get('PUBLISHED').getId() == 'index_html'
> 
> if is_home:
>     return '%s+home' % theme_id
> elif not context.portal_membership.isAnonymousUser():
>     return '%s+authenticated' % theme_id
> else:
>     return '%s+anonymous' % theme_id
> """

Ok, I try this right now. Thanks for the quick answer.

-- 
bruno desthuilliers
développeur
bruno at modulix.org
http://www.modulix.com


More information about the cps-devel mailing list
More information about CPS: CPS project - CVS - API

Hosting: Nuxeo: Zope service provider


This list archive provided by Nuxeo, the leaders of open source ECM. Check out the Nuxeo 5 open source, standards-based ECM project.