Moving the viewlet at the top


in my custom package, I've added a viewlet with plonecli. It works. Now I would like the viewlet to be at the top of the viewlet manager when my addon is installed. After reading the various docs, what I've added a GS profile step, viewlets.xml in profiles/default with this xml:

<?xml version="1.0" encoding="UTF-8"?>
 <order manager="plone.portalheader" skinname="*" based-on="Plone Default">
  <viewlet name="myaddon.topbarlinks" insertbefore="*"/>

Then I restarted, uninstalled my addon and installed it back, but the viewlet is still the last, not the first at the top, in the portalheader viewlet manager.

  1. What should I check to see what is wrong on moving the viewlet at the top?
  2. Plonecli inserted My Custom Theme in the skinname attribute, I've switched to * because I don't know how to find what is the skin name. Is it better to use the skin name instead of *. If so, how can I find the value of skinname?

If that's the exact xml you have added to viewlets.xml then it's correct that the viewlet was not moved to the top of the ordered manager. the attribute is "insert_before", not "insertbefore".

1 Like

insert-before, thanks!

What about skinname?

You're correct, never copy the first answer from a Search result online. (insert-before it is, not _).

In newly created Plone 5.2 sites there is only one 'old school' skin name left and it is called "Plone Default" . If you use "*" viewlets.xml for the skin name the viewlet registration will be done for all skins.

You can look up registered skin names in portal_skins -> properties in the ZMI, but this is all very much deprecated and no longer in use in Plone 5 and especially not in Plone 5.2.

Oh, it is that skin name! So it is safe using "*" or "Plone Default" for viewlets, otherwise ordering does not work.

Plone Foundation Code of Conduct