Did not find a how-to for your problem?

Ask me to write the how-to post by writing to the mailing-list at cps-devel [@] lists [.] nuxeo [.] com or writing to me to joseluisdelarosa+cpshowto [@] gmail [.] com. Note: I'll keep all conversations on the official mailing list.

Tuesday, July 10, 2007

How to hide a widget for a given workflow state

When dealing with workflows and states you may need to hide or show a widget of a layout depending on the current state of a document.

Suppose that you need to hide the widget Subject of the layout newsitem_end when the news item state is not 'published', then the TALES expression to use in the property "Hidden if" of the widget is:



python:context.getContentInfo(level=1)['review_state'] not in ['published']

And that's all, notice that TALES expressions are really powerful to hide and show widgets depending on the value of any other data in the portal.

See you!

2 comments:

Daniel Tellez said...

many thanks. it's really helpful.

Ju said...

Thanks a lot! It was really helpfull.
I searched this expression for many weeks!

I used it as a Condition in "portal_types/My_Type/" -> Actions

It works perfectly!