[triangle-zpug] Question - How to prevent folders showing up as Tabs

Chris Calloway cbc at unc.edu
Tue Jan 30 01:12:08 CET 2007


Robert Geiger wrote:
> Not being an expert in TAL

You can become and expert in TAL in about four hours by reading:

http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/AppendixC.stx

> how would one do this?

Replace:

>         <tal:tabs tal:repeat="tab portal_tabs"><li tal:attributes="id 
> string:portaltab-${tab/id};
>                             class 
> python:test(selected_portal_tab==tab['id'], 'selected', 'plain');">

with this (probably not ideal) hack:

         <tal:tabs tal:repeat="tab portal_tabs"><li tal:attributes="id
string:portaltab-${tab/id};
                             class
python:test(selected_portal_tab==tab['id'], 'selected', 'plain');"

tal:condition="python:context.portal_workflow.getInfoFor(context[tab['id']],'review_state','published')=='published'">

This will display only portal_tabs with a review_state of 'published' or
*no review state at all* (because portal_tabs are action objects which
don't have to refer to workflowed content) using the workflow in effect
on the object being browsed.

You might also want to walk through the machinery behind how "filter on
workflow state" works in Navigation Settings. It affects only the nav
tree and the site map, presumably, and not portal tabs.

-- 
Sincerely,

Chris Calloway
http://www.seacoos.org
office: 332 Chapman Hall   phone: (919) 962-4323
mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599




More information about the triangle-zpug mailing list