collective / lineage.themeselection

Theme Selection for Lineage Child-Sites
https://pypi.org/project/lineage.themeselection/
Other
4 stars 1 forks source link

provide correct browserlayer interface for requests on subsites #3

Closed frisi closed 10 years ago

thet commented 10 years ago

@frisi that pull request broke the theme of a site of mine.

alongside to the diazo theme i'm relying on a custom skin set on a lineage subsite, to which some resource registry bundles are bound to. with that change, it seems that my skin layer isn't active anymore.

frisi commented 10 years ago

sounds odd @thet... all this pr does is to make sure the request also implements the interface of a browserskintype registered under the same name as the activated skin selection. plone.theme.layer.mark_layer does the same but we can't be sure our traverser is called before it.

do you have editskinswitcher installed too? we're disabling skin selections if editskinswitched i present in the request.

if not, i'd suggest to test the implemented layers using a view like the following. once with this pr installed, once without.

from zope import interface
from Products.Five.browser import BrowserView
from your.theme.browser.interfaces import IThemeSpecific

class RequestProvides(BrowserView):

    def __call__(self):
        ifaces = interface.directlyProvidedBy(self.request)
        result = u''
        for iface in ifaces:
            result += "%r\n" % iface

        result += '\nimplements IThemeSpecific: %s\n' % IThemeSpecific.providedBy(self.request)

        varname = self.context.portal_skins.getRequestVarname()
        result += '\n%s request variable:%s ' % (varname, self.request.get(varname, None))
        result += '\n request variables: %s' % (str(self.request.keys()))

        return result
thet commented 9 years ago

another problem: https://github.com/collective/lineage.themeselection/issues/5