基于cookie切换重氮(plone.app.theming)主题
我希望能够使管理员能够更改当前仅用于他们的主题。可能通过设置 cookie 或特殊 url。这将使他们能够调试其主题的副本,同时另一个版本可供其他人使用。
I'd like to be able to enable administrators to change which theme is currently being used just for them. Possibly by setting a cookie, or special url. This will enable them to be able to debug a copy of their theme while another version is live for everyone else.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
支持这一点需要在 plone.app.theming 上进行工作,以便可以为不同的 CMF 皮肤配置不同的重氮主题。它在我的路线图上,但我不知道什么时候能实现。如果您有兴趣开发此功能或赞助它,请与我联系。
Supporting this would require work on plone.app.theming so that different diazo themes could be configured for different CMF skins. It's on my roadmap, but I don't know when I'll get to it. Contact me if you're interested in working on this feature or sponsoring it.
我做了类似的事情,使用主机名来决定使用哪个重氮主题。使用不同的rules.xml、index.html 和自定义资源没有问题。主题插件是另一个故事(覆盖、视图、浏览器层等),我不知道在每个请求上注册/取消注册主题插件有多好。
我回家后会更新此评论,以便您可以看到我做了什么。如果我没记错的话,我对从 plone.app.theming (应用主题的组件)注册的内容进行了子类化和替换。
I've made something similar that uses the hostname to decide which diazo theme to use. There was no problems having a different rules.xml, index.html and custom resources. The themingplugins was another story (overrides, views, browserlayer etc), I don't know how good it is to register/unregister themingplugins on each request.
I'll update this comment when I get home so you can see what I did. If I remember correctly I subclassed and replaced something registered from plone.app.theming (the component that applies the theme).
我没有尝试过,但它可能会这样工作:
为当前使用的主题定义一个参数。
请注意,您需要在portal_skins/manage_propertiesForm中启用“允许选择任意皮肤”
,并根据rules.xml中的此参数选择主题或规则集
i did not try this out but it could possibly work this way:
define a parameter for the currently used theme.
note that you'll need to enable "Allow arbitrary skins to be selected" in portal_skins/manage_propertiesForm
and select the theme or ruleset based on this parameter in your rules.xml