Skip to content

Button via "Link / Button" plugin is Not Button by Default #1096

@wesleyboar

Description

@wesleyboar

Is your feature request related to a problem? Please describe.
When creating a "Button" via Bootstrap4 "Link / Button" plugin, element should look like a button (but user must set "Type" to see button).

Link type Type
Image Image

Describe the solution you'd like
Ideas:

  • A. User is forced to choose type.
    ⚠️ But forcing choice for Link type of "Link" is unnecessary.
  • B. Form sets type dynamically.
    ⚠️ But what if user already made correct "Type" choice before changing "Link type"?

Describe alternatives you've considered
Editor always must choose "Type", but won't know that unless they see link (set as "Button") does not look like a button, or have learned already to set "Type".

Additional context
Solution proposed by AI, which could be integrated into bootstrap4_link/extend.py, is to require the field:

from django import forms
from djangocms_bootstrap4.contrib.bootstrap4_link.models import Bootstrap4Link

class Bootstrap4LinkForm(forms.ModelForm):
    class Meta:
        model = Bootstrap4Link
        fields = "__all__"

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        # example: make link_context and link_size optional
        self.fields["link_context"].required = False
        self.fields["link_size"].required = False

Important

How to prevent "Primary" being set for Links? It is okay if it is (CSS supports it), but it is unnecessary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority ▼Low priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions