Collective.xdv和多个主题文件 [英] collective.xdv and multiple theme files

查看:90
本文介绍了Collective.xdv和多个主题文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为不同的站点部分使用了不同的主题HTML文件.取决于页面是首页还是某个子节,在布局方面存在一些主要差异.

I am having different theme HTML files for different site sections. There are some major layout differences depending if the page is the front page, or a certain subsection.

据我所知,默认行为是只有一个HTML文件:

As far as I see the default behavior is just to have one HTML file:

http://pypi.python.org/pypi/collective.xdv#usage

使用多个主题文件,轻微的规则变化和Collective.xdv的最佳策略是什么?

What would be the best strategy to use multiple theme files, slight rule variations and collective.xdv?

克隆4.1b.

推荐答案

我们通常只使用纯xdv并使用rules.xml(或任何您想调用的文件)文件来设置主题模板,并将相应的属性保留在collection.xdv控制面板为空.分配不同的模板时,嵌套规则为您提供了一定的灵活性:

We usually just utilize plain xdv and use the rules.xml (or whatever you want to call it) file to setup the theme templates leaving the corresponding properties in the collective.xdv controlpanel empty. Nesting rules gives you quite some fexibility when asigning different templates:

<?xml version="1.0" encoding="UTF-8"?>
<rules xmlns="http://namespaces.plone.org/xdv"
   xmlns:css="http://namespaces.plone.org/xdv+css"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<theme css:if-content="body.section-front-page" href="frontpage.html" />
<theme css:if-path="/section/subsection/somefolder" href="somefolder.html" />
...
<rules css:if-content="#visual-portal-wrapper">
    <!-- The default theme -->
    <theme href="theme.html" />
    <rules css:if-content="body.section-somefolder">
        <!-- Secific rules for somefolder go here -->
        ...
    </rules>
</rules>

这篇关于Collective.xdv和多个主题文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆