Skip to content

Conversation

fsbraun
Copy link
Member

@fsbraun fsbraun commented May 28, 2024

When designing frontends it is key to avoid repeating template/HTML code. This PR makes djangocms-frontend components like alerts, cards, buttons or links, etc.

This PR provides a simple way to re-use djangocms-frontend plugins in templates:

{% load frontend %}
{% url "some-name" as link_target %}
{% plugin "link" external_link=link_target link_type="btn" link_context="primary" link_outline=False %}
    Click me!
{% endplugin %}

or

{% load frontend %}
{% plugin "card" card_alignment="center" card_outline="info"  card_text_color="primary" card_full_height=True %}
    {% plugin "cardinner" inner_type="card-header" text_alignment="start" %}
        <h4>Card title</h4>
    {% endplugin %}
    {% plugin "cardinner" inner_type="card-body" text_alignment="center" %}
        Some quick example text to build on the card title and make up the
        bulk of the card's content.
    {% endplugin %}
    {% plugin "listgroupitem" %}An item{% endplugin %}
    {% plugin "listgroupitem" %}A second item{% endplugin %}
    {% plugin "listgroupitem" %}A third item{% endplugin %}
{% endplugin %}

These plugins are not created in the database. They work with djangocms-frontend plugins and most other django CMS plugins.

@fsbraun fsbraun changed the title feat: Make frontend plugins re-usable components feat: Add re-usable components Oct 7, 2024
@fsbraun fsbraun merged commit a50d679 into django-cms:master Oct 7, 2024
21 of 23 checks passed
@fsbraun fsbraun deleted the feat/components branch October 7, 2024 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant