ワークフローを表示するポートレットの制作
ワークフローを表示するポートレットを作ってみた。 例 portal_skins/custom フォルダ内にPage Template を追加する。
名前は、portlet_workflow とする。
以下のコードをエディットエリア内にコピペして、保存をする。
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
i18n:domain="plone">
<body>
<div metal:define-macro="portlet" tal:omit-tag="">
<tal:block define="review_state wf_state;
transitions workflow_actions;"
condition="python:review_state and transitions ">
<dl class="portlet" id="portlet-artcityWorkflowPortlet">
<dt class="portletHeader">
<span i18n:translate="label_state">State:</span>
<span tal:content="python:putils.getReviewStateTitleFor(here)"
tal:attributes="class python:'state-'+normalizeString(review_state)"
i18n:translate="">
Workflow state
</span>
</dt>
<dd class="portletItemSingle odd">
<ul>
<tal:block repeat="transition transitions">
<li>
<a href="#"
i18n:translate=""
tal:content="transition/name"
i18n:attributes="title"
tal:attributes="href string:$here_url/content_status_modify?workflow_action=${transition/id};
title transition/name">File Menu Item 1</a>
</li>
</tal:block>
</ul>
</dd>
<dd class="portletFooter">
<a href="#"
tal:attributes="href string:$here_url/content_status_history"
i18n:translate="label_advanced">Advanced</a>
</dd>
</dl>
</tal:block>
</div>
</body>
</html>
次に、Portlのルートに移り、Properties タブをクリックする。
プロパティ項目 left_slots に以下の文を追加。
here/portlet_workflow/macros/portlet
Save Chenges ボタンをおす。
以上で、出来上がり。