django CMS的样式插件
项目描述
Aldryn Style提供了一个插件,该插件通过在包含元素上放置类名来包装其他插件CSS样式。
安装
此插件需要正确安装django CMS 2.4或更高版本。
在您的虚拟环境内运行 pip install aldryn-style
将 'aldryn_style' 添加到您的 INSTALLED_APPS 设置中。
运行 manage.py migrate aldryn_style。
使用方法
您可以在settings.py中定义样式和标签类型
# define this lambda if it isn't already defined in your settings... _ = lambda s: s ALDRYN_STYLE_CLASS_NAMES = ( ('info', _('info')), ('new', _('new')), ('hint', _('hint')), ) ALDRYN_STYLE_ALLOWED_TAGS = [ 'div', 'p', 'span', 'article', 'section', 'header', 'footer', ]
默认情况下,如果未提供 ALDRYN_STYLE_ALLOWED_TAGS 或包含空列表,则将默认为以下列表,以与旧版本保持向后兼容
ALDRYN_STYLE_ALLOWED_TAGS = [ 'div', 'article', 'section', 'p', 'span', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'footer', ]
注意
All tags included in this list should be "paired tags" that require a closing tag. It does not make sense to attempt to use 'button', 'input', 'img', or other self-closing tag 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 ``ALDRYN_STYLE_ALLOWED_TAGS`` (though, we do not prevent this). If you have an application where you find yourself wishing to do this, please see djangocms-snippet or aldryn-snippet as an alternative, but note these projects also come with appropriate security warnings.
之后,您可以在该样式插件内部放置任意数量的其他插件。它将为包含的插件创建一个带有先前选择的类的div(或其他标签类型)。
翻译
如果您想帮助翻译该插件,请到Transifex上操作
https://www.transifex.com/projects/p/django-cms/resource/aldryn-style/
项目详情
关闭
aldryn-style-1.1.4.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | cdf4bccf5be924ee59bcd481a1ee59392f8a3a39b98c1d6861bc9da517c31629 |
|
MD5 | e0de4d11842b5ddb05108f49e54343db |
|
BLAKE2b-256 | 1c739010c113b9068577d4085b55d8e1cf710d16683bef69a58d02f294a92463 |