cmsplugin-css-background
django CMS plugin for configuring background images in edit mode via CSS rules.
Requirements
Django 1.8+
django CMS 3.3+
Installation
In your Python environment run
$ pip install cmsplugin-css-background
This will install the latest stable version of the plugin package. To install the package’s latest repository snapshot run
$ pip install -e git+https://github.com/alexmalykh/cmsplugin-css-background.git@master#egg=cmsplugin-css-background
Then add the plugin to INSTALLED_APPS list:
INSTALLED_APPS = [
...,
'cmsplugin_css_background',
]
and finally, roll database migrations:
$ python manage.py migrate cmsplugin_css_background
Usage
Define a placeholder in your template like this:
{% with css_selector='#some-element' %} {% placeholder 'Placeholder Name' %} {% endwith %}The placeholder can be anywhere but it is recommended to keep it near the element specified by the CSS selector. Note that the selector can be any valid CSS selector, not just an id.
Add an instance of CSS Background from the Generic plugin group to the created placeholder on your page in the CMS admin.
Configure the required background CSS styling that will be applied to the element. All fields may be left blank if not required, but at least color or image must be provided. Omitted properties cascade down to corresponding lower-priority styling.
The CSS style definition is added to the sekizai css block in the <head/> element, in compliance with W3 specs:
<style type="text/css">
#some-element {
/* here 'background-' CSS rules go */
...
}
</style>
The template used is cmsplugin_css_background/css-background.html.
By default, background properties are rendered as a list of separate rules (which are omitted if not specified), but there is a shorthand option too. To use it just override cmsplugin_css_background/css-background.html template somewhere in your project tree and replace
{{ instance.as_separate_rules }}
with
{{ instance.as_single_rule }}
Metadata
Release files for cmsplugin-css-background 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| cmsplugin-css-background-0.2.0.tar.gz | 9.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cmsplugin_css_background-0.2.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 20.5 kB
Release files / cmsplugin-css-background-0.2.0.tar.gz
| Download URL | cmsplugin-css-background-0.2.0.tar.gz |
|---|---|
| Size | 9.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
67436a2e52b31ffb29e3948712031a8c6a08a78f0ebffa97c586356ea48753e2
|
|
BLAKE2b-256 checksum How to use checksums |
f33241fb7099bfc9eb98b45e05308b6017706d594192611b151c7036869f3ab7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / cmsplugin_css_background-0.2.0-py2.py3-none-any.whl
| Download URL | cmsplugin_css_background-0.2.0-py2.py3-none-any.whl |
|---|---|
| Size | 11.2 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
436fa92dfa49a30eba032f025ffacd3af1982954b0d30a3b9cacd67fcbbe855a
|
|
BLAKE2b-256 checksum How to use checksums |
129305cac18c554c807952feabfc81f6989ad4fb0912d982b53077842ed35efd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Security for cmsplugin-css-background 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.