Skip to main content

fluentcms-button

https://github.com/django-fluent/fluentcms-button/actions/workflows/tests.yaml/badge.svg?branch=master https://img.shields.io/pypi/v/fluentcms-button.svg https://img.shields.io/badge/wheel-yes-green.svg https://img.shields.io/pypi/l/fluentcms-button.svg https://img.shields.io/codecov/c/github/django-fluent/fluentcms-button/master.svg

Displaying a Bootstrap 3 Button in text.

This button can be used for navigation, for example at the end of a text block.

These buttons can’t be used in forms.

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. :-)

Release files for fluentcms-button 3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fluentcms-button 3.0
File Size Uploaded
fluentcms-button-3.0.tar.gz 13.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fluentcms-button 3.0
File Interpreter ABI Platform
fluentcms_button-3.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 27.8 kB

Release files / fluentcms-button-3.0.tar.gz

Download URL fluentcms-button-3.0.tar.gz
Size 13.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0311cf3924d76ee46597d20f524fd95bae8730340326d06e7a41df7bdaa30b2e
BLAKE2b-256 checksum
How to use checksums
9dd722e9aca7090a059e55b9279db19ab34d45086668b5ba673d8e6be06fc91d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6

Release files / fluentcms_button-3.0-py2.py3-none-any.whl

Download URL fluentcms_button-3.0-py2.py3-none-any.whl
Size 14.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
fa59d777ff92a1377f220d34328e3dfbc9db1aece7abd8056a6c31b781dcf4d4
BLAKE2b-256 checksum
How to use checksums
fa46e938883cb04f85aee8d80aee6779d2fb9ef1a76f386c2be0906abe419ee5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6

Release history Release notifications | RSS feed

This release

3.0 This release

2 release files

2.0

2 release files

1.2.1

2 release files

1.2

2 release files

1.1.1

2 release files

1.1

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page