[Zope-CMF] plone: portal_actions conditions

Tres Seaver tseaver@zope.com
10 Jul 2002 13:30:08 -0400


On Wed, 2002-07-10 at 07:29, Jan Ulrich Hasecke wrote:
> Tres Seaver <tseaver@zope.com> writes:
> 
> > On Tue, 2002-07-09 at 13:00, Jan Ulrich Hasecke wrote:
> >
> >> I would like to add a global tab called "english version" or "german
> >> version" into my plone-site. I am sure I can insert a condition like
> >> this:
> >> 
> >> If Language=german display "english version"
> >> If Language=english display "german version"
> >> 
> >> What do I have to insert into the field "Condition" in portal_actions
> >> (Actions) to aquire this?
> 
> [overview]
> 
> 
> > So, in your case, you could use:
> >
> >   python: request.get( 'Language', 'de' ) == 'en'
> >
> > or::
> >
> >   python: request.get( 'Language', 'de' ) == 'de'
> 
> 
> Thanks a lot for your short how-to. Do this condition applies on the
> language-setting of the browser reading the page? 
> 
> I want to apply it on the Language-field of the Dublin Core
> Metadata. So that every german page would link either to the english
> starting page or to the specific english version of the given
> document and vice versa.

You can access the DublinCore interface of the content object, e.g.::

   python:  here.Language() == 'en'

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com