ploneviewlets

How to move the documentactions viewlet from a viewletmanager to another?


Once again back with a Plone question.

I have Plone 4 installed and I need to show the Document action icons at the top instead of bottom. having trouble in getting this to work. can someone help.


Solution

  • If you just need to move that viewlet (with same class and template), first you have to register a viewlet with same class to your desired viewletmanager (let's say for ex. 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"
        />
    

    and then add this in your genericsetup profile (file 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>
    

    More info: