如何将规则应用到 plone.app.theming diazorules.xml 中的主页
我正在尝试为网站的主页创建特定规则。目前我使用这个规则:
<before css:theme="#mppeditbar" content="/html/body/*" if-path="/Plone/" href="slideshow/index.htm"/>
它适用于 localhost,但不适用于 Plone 前面的代理路径。
我如何将此规则应用于我网站的主页?
I'm trying to create a specific rule for the home page of a site. At the moment I use this rule:
<before css:theme="#mppeditbar" content="/html/body/*" if-path="/Plone/" href="slideshow/index.htm"/>
It works for localhost, but not with a proxy path in front of Plone.
How could I apply this rule to home page of my site ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
像
css:if-content="body.section-front-page"
这样的东西应该可以解决问题。如果您的规则条件基于实际内容,您甚至可以检查单个元素,例如css:if-content="#frontpage-scrollable
以切换到专用的首页主题模板。Something like
css:if-content="body.section-front-page"
should do the trick. If you base your rule conditions on the actual content, you can even check for single elements like e.g.css:if-content="#frontpage-scrollable
for switching to a dedicated front page theme template.我假设您正在使用带有代理的虚拟主机。这会将路径从 /Plone/ 更改为 /。您可以在 if-path 中包含多个空格分隔的路径,但通过 Plone 测试,主体类通常是最简单的方法。
再想一想,我可能会认为这是一个错误。对于 plone.app.theming,包含根植于站点根目录,所以我猜 if-path="/" 应该可能匹配 localhost:8080/Plone。
I'm presuming you're using virtual hosting with the proxy. That will change the path from /Plone/ to /. You can include multiple whitespace separated paths in if-path, but with Plone testing the body class is normally the easiest way to do it.
On second thoughts, I might consider this a bug. With plone.app.theming, includes are rooted at the site root, so I guess if-path="/" should probably match localhost:8080/Plone.