[Zope-CMF] Published content...
Antony Higgs
ahiggs@brookes.ac.uk
Wed, 19 Mar 2003 15:51:29 +0000
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<font face="Arial,Helvetica">Hi,</font>
<p><font face="Arial,Helvetica">We have built a page on our site that displays
a list of staff members. Each staff member is created through a 'Scriptable
Type Information' content type called 'Staff Member'.</font>
<p><font face="Arial,Helvetica">The page lists all the staff members using
the following...</font>
<p><font face="Arial,Helvetica"><font color="#CC0000"><tal:block tal:define="AllStaff
python:here.getObjectsByPortalType(here.objectItems('Document'),'Staff
Member')"></font></font>
<br><font face="Arial,Helvetica"><font color="#CC0000"><tal:block tal:repeat="Staff
AllStaff"></font></font>
<br><font face="Arial,Helvetica"><font color="#CC0000">.....</font></font>
<br><font face="Arial,Helvetica"><font color="#CC0000">.....</font></font>
<br><font face="Arial,Helvetica"><font color="#CC0000"></tal:block></font></font>
<br><font face="Arial,Helvetica"><font color="#CC0000"></tal:block></font></font><font face="Arial,Helvetica"><font color="#CC0000"></font></font>
<p><i><font face="Arial,Helvetica"><font color="#000000">(The 'getObjectsByPortalType'
function simply returns a list of just 'Staff Member' types from 'objectItems('Document')'
since there are other content types in here that are 'Document' which we
don't want.)</font></font></i><font face="Arial,Helvetica"><font color="#000000"></font></font>
<p><font face="Arial,Helvetica"><font color="#000000">This works fine until
a 'Staff Member' is added but left 'un-published', when viewing the page
the user is prompted to login! Bad!</font></font><font face="Arial,Helvetica"><font color="#000000"></font></font>
<p><font face="Arial,Helvetica"><font color="#000000">I would have thought
that 'objectItems()' would just return published content. I guess not!</font></font><font face="Arial,Helvetica"><font color="#000000"></font></font>
<p><font face="Arial,Helvetica"><font color="#000000">Any ideas how we
show the page with just the published content?</font></font>
<br><font face="Arial,Helvetica"><font color="#000000"></font></font> <font face="Arial,Helvetica"><font color="#000000"></font></font>
<p><font face="Arial,Helvetica"><font color="#000000">Cheers</font></font><font face="Arial,Helvetica"><font color="#000000"></font></font>
<p><font face="Arial,Helvetica"><font color="#000000">Antony</font></font></html>