473,394 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Show the review state of an item in Plone

Leo
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,
'&nbsp;')"
tal:attributes="class python:test(review_state,
'state-'+review_state, 'state-private')"
i18n:translate="">&nbsp;
</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,
'&nbsp;')"
tal:attributes="class python:test(review_state,
'state-'+review_state, 'state-private')"
i18n:translate="">&nbsp;
</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.
Jul 18 '05 #1
2 2389
lf**********@quicknet.nl (Leo) writes:
Error Type
NameError
Error Value
name 'getInfoFor' is not defined


Using TAL you're in Zope land AFAIK, and getInfoFor() isn't a method I
can find in that API. You need to prefix - or even import - the
package, e.g. workflow_tool.getInfoFor(...).
Jul 18 '05 #2
Tor Iver Wilhelmsen wrote:
lf**********@quicknet.nl (Leo) writes:

Error Type
NameError
Error Value
name 'getInfoFor' is not defined

Using TAL you're in Zope land AFAIK, and getInfoFor() isn't a method I
can find in that API. You need to prefix - or even import - the
package, e.g. workflow_tool.getInfoFor(...).


Thank you for your answer. In fact, you pointed me to te right
direction. The getInfoFor is a method defined by the portal_workflow
module. A correct way to show the review state of an item in Plone is:

<h2
tal:define="wtool here/portal_workflow;
review_state python: wtool.getInfoFor(here, 'review_state')"
tal:content=review_state>
</h2>
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Tony Ha | last post by:
Hello Can some one explain what are the differences between "plone" and "Apache + mod_python"? From plone.org. It says "Plone is powerful and flexible. It is ideal as an intranet and...
0
by: JZ | last post by:
I would like to exclude some files from Plone control within the same virtual host. The problem is, I cannot use mod_rerwite because Plone needs mod_proxy for working correctly. So the following...
18
by: Ben Hanson | last post by:
I have created an open source Notepad program for Windows in C++ that allows search and replace using regular expressions (and a few other extras). It is located at...
0
by: krzychu | last post by:
Hallo, I have an existing plone site called "info", I've added some scripts to it. I would like to have that plone site into a separate ZODB database(separate ..fs file). There is a MountFolder...
7
by: Grant Schenck | last post by:
Hello, I have a ListBox control on a form. I add members of a class to the Items collection. They show up and I can select them. The text shown is from my classes ToString override. Now,...
0
by: sub | last post by:
I'm using plone primary as a news system for my school. Now I want to integrate external sources into my plone site. The page is...
3
by: wheel | last post by:
I'm not sure if this is the right venue for Plone questions, if not, could someone ref me to a better one? The discussion groups on the plone site are mailing lists and I'd rather not subscribe...
11
by: kbperry | last post by:
Hi everyone, I am currently a student, and for our HCI class project we are redeveloping our CS website. I attend a very large university (around 30,000 students), and the CS site will need to be...
9
by: Norm | last post by:
Hi, without meaning to start a flame war between the various python web tools, I was wondering if anyone had a review of the status of Zope. For example, is it being used for new projects or...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.