Skip to main content
https://badge.fury.io/py/feincms-button.svg https://img.shields.io/pypi/pyversions/feincms-button.svg https://img.shields.io/pypi/djversions/feincms-button.svg https://github.com/bashu/feincms-button/actions/workflows/test.yml/badge.svg

Displaying a Bootstrap 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 make sure the project is configured for feincms.

Then add the following settings:

INSTALLED_APPS += (
    'feincms_button',
)

Now, you can create ButtonContent content type:

from feincms.module.page.models import Page
from feincms_button.contents import ButtonContent

Page.create_content_type(ButtonContent)

Frontend styling

The button is rendered with the HTML that Bootstrap prescribes:

<a class="btn btn-secondary" href="#" role="button">Link</a>

The standard Bootstrap CSS will provide a reasonable styling for this, which can either be overwritten, or replaced in your own CSS files. The defaults provided by Bootstrap are defined here: https://github.com/twbs/bootstrap/blob/main/scss/_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

FEINCMS_BUTTON_STYLES = (
    ('btn-secondary', 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")),
)

FEINCMS_BUTTON_SIZES = (
    ('', pgettext_lazy("button-size", u"Default")),
    ('btn-lg', pgettext_lazy("button-size", u"Large")),
    ('btn-sm', pgettext_lazy("button-size", u"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. :-)

Changes

26.8.0 (2026-08-14)

  • Required FeinCMS 26+ and updated ButtonContent.render() for FeinCMS’s AutoRenderTuple-based render API (FeinCMS 22.x+), replacing the removed feincms._internal.ct_render_to_string.

  • Dropped Python < 3.10 and Django < 5.2 support; added Django 6.0 / 6.1 support.

  • Migrated the rendered button markup and default styles/sizes from Bootstrap 3 to Bootstrap 5.

2.0.1 (2021-11-28)

  • Added ru translation.

2.0.0 (2021-11-27)

  • Added Django 3+ support.

  • Dropped Python 2.7 support.

  • Dropped Django 1.10 / 1.11 support.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

feincms_button-26.8.1.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

feincms_button-26.8.1-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file feincms_button-26.8.1.tar.gz.

File metadata

  • Download URL: feincms_button-26.8.1.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for feincms_button-26.8.1.tar.gz
Algorithm Hash digest
SHA256 37cf98dac00ba12e408a6e633edddf36014eb86bbcb36257ab9476eee05ad18a
MD5 b7e4c5538020570fd42ee03fc64fa87e
BLAKE2b-256 9a2b4d131d72aca7a6fb629bc852d2609c2d8fe3136f7694e99c5bcfff3293c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for feincms_button-26.8.1.tar.gz:

Publisher: release.yml on bashu/feincms-button

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file feincms_button-26.8.1-py3-none-any.whl.

File metadata

  • Download URL: feincms_button-26.8.1-py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for feincms_button-26.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 383d149c2cb10a34f8353c170cf8bc95adb6b8cb9096fb209bc315b9b73139f9
MD5 7e26e9b0ac17db8ecc23a21fab143f57
BLAKE2b-256 28a84dc087ff9a04822e7b3e70ded0fcc1c8dfecface1296de2c1b1cb71db059

See more details on using hashes here.

Provenance

The following attestation bundles were made for feincms_button-26.8.1-py3-none-any.whl:

Publisher: release.yml on bashu/feincms-button

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

26.8.1 This release

2 files

2.0.1

2 files

2.0.0

2 files

1.0

2 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