如何将documentactions viewlet从viewletmanager移动到另一个?

时间:2011-11-22 16:55:13

标签: plone viewlets

再次提出Plone问题。

我安装了Plone 4,我需要在顶部而不是底部显示Document操作图标。让它工作有困难。可以有人帮忙。

1 个答案:

答案 0 :(得分:4)

如果您只需要移动该Viewlet(使用相同的类和模板),首先必须将具有相同类的Viewlet注册到您想要的viewletmanager(比如说plone.app.layout.viewlets.interfaces.IAboveContentBody):

<browser:viewlet
    name="plone.abovecontenttitle.documentactions"
    manager="plone.app.layout.viewlets.interfaces.IAboveContentBody"
    class="plone.app.layout.viewlets.content.DocumentActionsViewlet"
    permission="zope2.View"
    />

然后将其添加到您的genericsetup配置文件(文件viewlets.xml)中:

<?xml version="1.0"?>
<object>
 <order manager="plone.abovecontentbody" skinname="Plone Default">
  <!-- this will place your viewlet before all the others.
       you can also use a viewlet's name for a relative position -->
  <viewlet name="plone.abovecontenttitle.documentactions" insert-before="*"/>
 </order>

 <hidden manager="plone.belowcontentbody" skinname="Plone Default">
  <viewlet name="plone.abovecontenttitle.documentactions"/>
 </hidden>
</object>

更多信息: