I've added a viewlet do be hidden in viewlets.xml in an upgradeStep and executed portal_setup but it's not working since the viewlet it's still being rendered (even using skinname="*" in the xml). Here's is what I did to see if the xml file was correctly imported:
I added ?diazo.off=1 in my url, to be certain that Diazo isn't mangling stuff, but the viewlet is still rendered;
I exported viewlets.xml from portal_setup and the viewlet is shown there as "hidden" but it's still being rendered.
I would like to know what else can I do to debug it to try to find what the hell is going on. Just for the sake of example, I'm trying to hide in my.package a viewlet that is registered in collective.package.
Do you have the hidden viewlet listed in the correct manager? Does it appear in more than one manager? Also providing your viewlets.xml would be helpful.
So, it seems that you can only try to use hidden for a viewlet in viewlets.xml if it was prior registered in another viewlets.xml. Can anyone confirm this? Indeed this is what makes sense, I was only dreaming that if the xml did nothing a warning would have been nice.
brasil.gov.portal customizes collective.nitf and we're upgrading from 1.x to 2.x there, but that big image in articles isn't expected in IDGB layout, so it needs to be hidden.
We can't use TextOnlyView because we need the get_images method that is only at View.
Anyways, since you didn't give a layer, the simplest way was to customize the viewlet adding an empty template with our layer.
This is a very specific case, we have a package named brasil.gov.portal that customized a browser view in collective.nitf 1.x. brasil.gov.portal will use collective.nitf 2.x, and that customized view now has an associated viewlet that isn't expected in the layout standards of brasil.gov.portal, so we need to hide it, and couldn't do it using viewlets.xml. We just don't know if it doesn't work because of what we think is the problem or what @hvelarde says.
This is not a problem with collective.nitf that it's going fine, it's with our package and our specific customization.
@hvelarde the solution for hiding can be achieved using overrides.zcml (which we think is overkill) but since you don't ask for collective.nitf's layer in your viewlet zcml registration we can just override it by putting in our zcml with our layer and an empty template.
We already know alternative ways to acomplish the task of hiding it, the motivation of this post is just to try to understand why viewlets.xml with hidden doesn't work in specific cases.