向django cms添加样式插件

djangocms-style的Python项目详细描述


pypibuildcoverage

django cms styledjango CMS的插件 允许您创建包含类、样式、id的html容器 以及其他可以通过插件设置定义的属性。

此加载项与Divio Cloud兼容,也可以在 django CMS Marketplace 便于安装。

preview.gif

贡献

这是一个开源项目。我们很高兴收到您的 以问题和请求的形式提供反馈。在提交您的 拉动请求,请查看我们的contribution guidelines

此加载项与Divio Cloud兼容,也可以在 django CMS Marketplace 便于安装。

你能做的最简单的贡献之一就是帮助翻译这个插件 Transifex

文档

请参阅setup.py中的REQUIREMENTS。 其他依赖项的文件:

pythondjangodjangocms

安装

对于手动安装:

  • 运行pip install djangocms-style
  • djangocms_style添加到INSTALLED_APPS
  • 运行python manage.py migrate djangocms_style

配置

Django CMS样式允许您提供一个预定义类的列表 显示为第一个选项,默认选项为:

DJANGOCMS_STYLE_CHOICES = ['container', 'content', 'teaser']

我们鼓励您将该设置修改为项目规范。

此加载项为所有实例提供default模板。你可以提供 通过添加^{tt7}来选择其他模板$ 设置:

DJANGOCMS_STYLE_TEMPLATES = [
    ('feature', _('Feature')),
]

您需要在^{tt8}中创建功能文件夹$ 否则,将获得一个^ {EM1} $模板不存在“EEM>错误”。你可以通过 复制目录中的default文件夹并将其重命名为 feature

还可以配置可用的标记,默认选项为:

DJANGOCMS_STYLE_TAGS = ['div', 'article', 'section', 'header', 'footer',
                        'h1', 'h2', 'h3', 'h4', 'h5', 'h6']

注意:

All tags included in this list should be "paired tags" that require a
closing tag. It does not make sense to attempt to use 'img', 'input',
'meta', or other self-closing tags in this setting.

Also, the developer is advised to choose the tag-types wisely to avoid HTML
validation issues and/or unintentional security vulnerabilities. For
example, the 'script' tag should never be allowed in
``DJANGOCMS_STYLE_TAGS`` (though, we do not prevent this). If you have
an application where you find yourself wishing to do this, please see
djangocms-snippet as an alternative, but note these projects also come
with appropriate security warnings.

在那之后,你可以在这个样式插件中放置任何数量的其他插件。 它将创建一个div(或其他标记类型),其中包含先前选择的类 在包含的插件周围。

运行测试

您可以执行以下操作来运行测试:

virtualenv env
source env/bin/activate
pip install -r tests/requirements.txt
python setup.py test

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

推荐PyPI第三方库


热门话题
与ReentrantLock相比,java ReentrantReadWriteLock的性能非常差   java如何使用Maven Android Studio正确导入?   安卓将ADB添加到我的Java PC应用程序   反射Java getDeclaredConstructor失败,来自JUnit的NoSuchMethodException   JSP上siteedit标记库的java替代   JavaSpring环境概要文件和JPA   java中是否有一个类似于StringBuilder的类,唯一的区别是它具有固定的长度?   JavaMathContext。小数点32 vs MathContext。小数点64,使用哪一个,为什么?   java使用spring在Ibm Websphere MQ中实现重试逻辑   java调用SpriteBatch。开始()和结束()   java有一种从文本中读取文本的方法。文件,并将其设置为pom中的maven属性。xml专家?   java让sitemesh使用struts2   Java Swing:在现有窗口上定位对话框   使用带有MemSql的JPA本机查询的java Select json列