Search code examples
plonexdv

collective.xdv - define an alternative theme breaks transform for default theme


I'm using plone 4.0.1 + collective.xdv 1.0rc11 and I need to use different themes.

I'm trying to do as described in a recent question/answer but when I insert a new theme with a condition I get no transform at all for the default theme. Here are some examples of what I tried:

<rules css:if-content="body.section-mysection">
    <theme  href="mysection.html" />
</rules>

this ends in:

Traceback (innermost last):
  Module ZPublisher.Publish, line 132, in publish
  Module zope.event, line 23, in notify
  Module zope.component.event, line 26, in dispatch
  Module zope.component._api, line 138, in subscribers
  Module zope.component.registry, line 323, in subscribers
  Module zope.interface.adapter, line 575, in subscribers
  Module plone.transformchain.zpublisher, line 93, in applyTransformOnSuccess
TypeError

While these:

<theme  href="mysection.html" if-path="/mysection/"/>

<theme  href="mysection.html" css:if-content="body.section-mysection"/>

both work for the given section BUT for the rest of the portal there is no transform at all.

I tried to specify also the default theme in the rules.xml (even if it's already registered into @@xdv-settings) with <theme href="index.html" /> but got no luck.

What am I missing here?

Thanks in advance, SimO


Solution

  • First, I would consider moving on to plone.app.theming. The upgrade/change is fairly trivial as I understand it (http://pypi.python.org/pypi/plone.app.theming#migrating-from-collective-xdv) and p.a.theming provides all the latest and greatest features that were developed under collective.xdv.

    Second, I would reference this document:

    It sounds like you just need to configure the default theme first, and then add a condition(s) to change the appropriate section when the condition matches. The additional matched theme should not affect the "default" (first matched) theme.