Installation
First install the module, preferably in a virtual environment. It can be installed from PyPI:
pip install fluentcms-button
First make sure the project is configured for django-fluent-contents.
Then add the following settings:
INSTALLED_APPS += (
'fluentcms_button',
)
FLUENT_CONTENTS_PLACEHOLDER_CONFIG = {
'slot name': {
'plugins': ('ButtonPlugin', ...),
},
}
The database tables can be created afterwards:
./manage.py migrate
Frontend styling
The button is rendered with the HTML that Bootstrap prescribes:
<a class="btn btn-default" href="#" role="button">Link</a>
The standard Bootstrap 3 CSS will provide a reasonable styling for this, which can either be overwritten, or replaced in your own CSS files. The defaults provided by Bootstap 3 is: https://github.com/twbs/bootstrap-sass/blob/master/assets/stylesheets/bootstrap/_buttons.scss
When you use Sass, you can also override the Sass variables.
Configuration
When desired, the following settings can be overwritten:
from django.utils.translation import pgettext_lazy
FLUENTCMS_BUTTON_STYLES = (
('btn-default', pgettext_lazy("button-style", u"Default")),
('btn-primary', pgettext_lazy("button-style", u"Primary")),
('btn-success', pgettext_lazy("button-style", u"Success")),
('btn-info', pgettext_lazy("button-style", u"Info")),
('btn-warning', pgettext_lazy("button-style", u"Warning")),
('btn-danger', pgettext_lazy("button-style", u"Danger")),
('btn-link', pgettext_lazy("button-style", u"Link")),
)
FLUENTCMS_BUTTON_SIZES = (
('', pgettext_lazy("button-size", u"Default")),
('btn-lg', pgettext_lazy("button-size", u"Large")),
('btn-sm', pgettext_lazy("button-size", u"Small")),
('btn-xs', pgettext_lazy("button-size", u"Extra Small")),
)
By default, the standard Bootstrap button classes are used. These can be redefined when the project uses other classes for the buttons.
Contributing
If you like this module, forked it, or would like to improve it, please let us know! Pull requests are welcome too. :-)
Metadata
Release files for fluentcms-button 1.1.1
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 | Actions |
|---|---|---|---|---|
| fluentcms-button-1.1.1.tar.gz | 11.0 kB | Without provenance | Details for fluentcms-button-1.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fluentcms_button-1.1.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for fluentcms_button-1.1.1-py2.py3-none-any.whl |
Total release size: 23.1 kB
Security for fluentcms-button 1.1.1
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.