主题切换程序

collective.themeswitcher的Python项目详细描述


简介

此加载项提供了一个浏览器视图@@Themeswitcher,它应用于根目录 让您重写plone所有主题技术上使用的主题。

这个插件是为集成商设计的。

plone主题堆栈

门户皮肤

这是CMF最古老的作品。

这件是蒙克斯派克的。

浏览器层

在zope3中,这是创建和覆盖视图的现代方式,因此 “ViewPageTemplateFile”。

这个已经由门户皮肤上的plone.theme设置。

重氮

最后一种技术是在呈现页面之后生成xslt 在plone呈现的页面上进行转换。

这件是蒙克斯派克的。

切换器

这个插件的设计很容易支持新的切换器。目前 唯一实现的切换器是“移动切换器” 基于来自http://detectmobilebrowsers.com/(python版本)的用户代理。

关于切换器的一些想法可以很容易做到:

  • 打开域
  • 打开协议(http/https)
  • 打开角色
  • 打开路径
  • 打开设备(移动、平板电脑、桌面)
  • 打开cookie值

如何使用

您只需在portal_注册表中配置要使用的切换器 并对其进行配置。

要使用特定的重氮主题,你必须将它的设置复制到switcher 登记处。

例如,假设您只想将plonetheme.mobile用于移动设备 您必须使用以下命令添加registry.xml:

<record name="collective.themeswitcher.theme.mobile">
  <field type="plone.registry.field.ASCIILine">
      <title>Mobile theme</title>
  </field>
  <value>plonetheme.mobile</value>
</record>
<record name="collective.themeswitcher.switcher">
  <field type="plone.registry.field.TextLine">
      <title>Theme switcher</title>
      <description>The named switcher that will be used</description>
  </field>
  <value>themeswitcher_mobile</value>
</record>
<record name="collective.themeswitcher.absolutePrefix" interface="plone.app.theming.interfaces.IThemeSettings" field="absolutePrefix">
  <field type="plone.registry.field.TextLine">
    <description>convert_relative_url</description>
    <required>False</required>
    <title>absolute_url_prefix</title>
  </field>
  <value>/++theme++plonetheme.mobile</value>
</record>
<record name="collective.themeswitcher.currentTheme" interface="plone.app.theming.interfaces.IThemeSettings" field="currentTheme">
  <field type="plone.registry.field.TextLine">
    <description>current_theme_description</description>
    <title>current_theme</title>
  </field>
  <value>plonetheme.mobile</value>
</record>
<record name="collective.themeswitcher.doctype" interface="plone.app.theming.interfaces.IThemeSettings" field="doctype">
  <field type="plone.registry.field.ASCIILine">
    <default></default>
    <description>doctype_description</description>
    <required>False</required>
    <title>doctype</title>
  </field>
  <value>&lt;!DOCTYPE html&gt;</value>
</record>
<record name="collective.themeswitcher.enabled" interface="plone.app.theming.interfaces.IThemeSettings" field="enabled">
  <field type="plone.registry.field.Bool">
    <default>False</default>
    <description>enable_theme_globally</description>
    <title>enabled</title>
  </field>
  <value>True</value>
</record>
<record name="collective.themeswitcher.hostnameBlacklist" interface="plone.app.theming.interfaces.IThemeSettings" field="hostnameBlacklist">
  <field type="plone.registry.field.List">
    <default>
      <element>127.0.0.1</element>
    </default>
    <description>hostname_blacklist_description</description>
    <required>False</required>
    <title>hostname_blacklist</title>
    <value_type type="plone.registry.field.TextLine"/>
  </field>
  <value>
    <element>127.0.0.1</element>
  </value>
</record>
<record name="collective.themeswitcher.parameterExpressions" interface="plone.app.theming.interfaces.IThemeSettings" field="parameterExpressions">
  <field type="plone.registry.field.Dict">
    <default/>
    <description>parameter_expressions_description</description>
    <key_type type="plone.registry.field.ASCIILine"/>
    <required>False</required>
    <title>parameter_expressions</title>
    <value_type type="plone.registry.field.ASCIILine"/>
  </field>
  <value>
    <element key="ajax_load">python: request.form.get('ajax_load')</element>
  </value>
</record>
<record name="collective.themeswitcher.readNetwork" interface="plone.app.theming.interfaces.IThemeSettings" field="readNetwork">
  <field type="plone.registry.field.Bool">
    <default>False</default>
    <description>network_urls_allowed</description>
    <title>readNetwork</title>
  </field>
  <value>False</value>
</record>
<record name="collective.themeswitcher.rules" interface="plone.app.theming.interfaces.IThemeSettings" field="rules">
  <field type="plone.registry.field.TextLine">
    <description>rules_file_path</description>
    <required>False</required>
    <title>rules_file</title>
  </field>
  <value>/++theme++plonetheme.mobile/rules.xml</value>
</record>

如何安装

https://secure.travis-ci.org/toutpt/collective.themeswitcher.png

此加载项可以安装有任何其他加载项。请遵循官方 documentation

学分

更改日志

1.0a2(2013-04-29)

  • 什么都没变。

1.0a1(2013-04-20)

  • 使用templer创建的包 [jeanmichel aka toutpt]

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java正确使用setCellValueFactory   java当使用flavor维度时,设置Android applicationId的正确方法是什么?   java为了在测试用例中并发执行某些步骤,可以克隆WebDriver实例   JAVA中的If语句给出错误   java在kindle上使用JavaFX   java如何在屏幕上显示多个视图时提高性能?   java“重命名”文件项   使用kafka运行Spark流媒体示例时出现java NoSuchMethodError   java如何在查询视图时返回实体列表   java在条件表达式中使用equals方法   java实现了一种回调机制,用于通知插入/更新   java我想用动态的方式把这个json做成表格式,我怎样才能用安卓来制作呢?   java在另一个字符串的特定点输入字符串时遇到问题   java如何在SeleniumWebDriver中选择xpath中具有动态值的对象   JavaJooq生成一个静态方法来调用函数,但没有方法将其作为字段   scala文件名包含斜杠标点符号,并在线程“main”java中给出异常。木卫一。FileNotFoundException:foo/boo/en_en。json(没有这样的文件或目录)   java使用Saxon和XSLT转换JDOM XML文档   使用Java数组   java从smb文件夹读取文件   java在where in子句中没有值时如何执行查询