Show the review state of an item in Plone

Leo lf.van.geest at quicknet.nl
Sun May 30 10:47:04 EDT 2004


I have the following problem:

When looking at a document, we would like to see what the review state
of that document is.

I set out to make a custom document_view page template based on the
default page template, together with some code from the
folder_contents page template.

I got the following code from folder_contents:

<td class="private"
  tal:define="review_state python:getInfoFor(item, 'review_state',
'')"
  tal:content="structure python:test(review_state, review_state,
' ')"
  tal:attributes="class python:test(review_state,
'state-'+review_state, 'state-private')"
                        i18n:translate=""> 
</td>

and pasted somewhere after the H1 of the document_view page template
to read:

<h2
  tal:define="review_state python:getInfoFor(here, 'review_state',
'')"
  tal:content="structure python:test(review_state, review_state,
' ')"
  tal:attributes="class python:test(review_state,
'state-'+review_state, 'state-private')"
                        i18n:translate=""> 
</h2>

that is, I changed the 'td' to 'h2' and 'item' to 'here'.

After saving the customized page template and navigating to a document
in Plone I got the following error:


Site error

This site encountered an error trying to fulfill your request. The
errors were:

Error Type
    NameError
Error Value
    name 'getInfoFor' is not defined
Request made at
    2004/05/30 16:44:04.453 GMT+2


I am using Plone 2 (the Windows binary distribution).

Any help is apreciated.

Leo.



More information about the Python-list mailing list