after whining yesterday the #plone irc about struggling with moving viewlets
between viewlet managers (and getting some useful hints - thanks, spliter!).
 along the way i tried to distinguish what was so confusing, and came up
with a few things.

   1. need to refer to viewlets and viewlet managers by their interfaces
   sometimes (eg, in configure.zcml) and by their ids (eg, in viewlets.xml).
   2. arriving at both the ids and interfaces is not so easy unless you know
   about using, and how to read, the @@manage-viewlets view.  (gloworm would be
   great, too, but it's not working for me in plone 4.)
   3. on similar lines, it's crucial to keep straight when to refer in your
   configuration to viewlets and when to refer to viewlet managers - eg, in
   viewlets.xml you might specify the <order> of viewlets within a viewlet
   manager
   4. when moving a viewlet, sometimes you must specify the new manager in
   the viewlet's declaration (eg, in configure.zcml) and sometimes you do not.

   specifically, i needed to redeclare a viewlet i was moving because i was
   also giving it a different template.  it turns out that i had to designate
   the right viewlet manager in that declaration.  ok, but it also turns out
   that i did not need to redeclare other viewlets i was moving in order to
   specify the new manager.  that's not a bad thing, but inconsistent - you
   don't need to redeclare viewlets just to change the "manager=" field, but
   you need to set the right manager= field for the viewlets you are
   redeclaring, in order to see the changed version where you want it.

   in general, the interaction between configure.zcml + viewlets.xml +
   viewlets.py is just too intricate.
   5. i'm probably dim, but it took me a while to realize exactly where the
   skin name for my theme resides.  it's the value of the "name=" attribute of
   the *skin-path* declaration in skins.xml <skin-path name="..." ...>.  if
   you change the skin-path name, don't forget to change the <object ...
   default_skin= ...> attribute value, or your portal won't be viewable.

ultimately, the whole thing feels like a multi-factor encryption puzzle,
with a *lot* of restarts necessary to try out changes, and zcml's/xml
configuration's obstinate insusceptibility to flag-based debugging to tell
what's happening when things aren't working - it's much too often like
shooting in the dark - blackbox debugging - to try to track things down.
 hopefully the above info will reduce some of the mystery for others, as it
has for me.

some references that have been particularly useful along the way:

   - overriding a
viewlet<http://plone.org/documentation/kb/customizing-main-template-viewlets/overriding-a-viewlet>
   - moving a 
viewlet<http://plone.org/documentation/kb/customizing-main-template-viewlets/moving-a-viewlet>
   - updating plone 3 templates to work in plone
4<http://plone.org/documentation/manual/upgrade-guide/version/upgrading-plone-3-x-to-4.0/updating-add-on-products-for-plone-4.0/updating-plone-3-themes-for-plone-4>
(warning
   to use *Plone Classic Theme* vs *Plone Default* for my base skinname)

this seems like it might be a good knowledge base article on plone.org, if i
can get the details right.  corrections and supplements appreciated...
-- 
ken
http://myriadicity.net
_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers

Reply via email to