EC System

Fieldsets

Styling and template for the <fieldset> tag.

{#
  Parameters:
    - "content" (string) (default: '')
    - "extra_classes" (string) (default: '')
    - "extra_attributes" (array) (default: []): format: [
        {
          "name" (string) (default: ''),
          "value" (string) (default: '')
        },
        ...
      ]
  Blocks:
    - "fieldset": main content
#}

{# Internal properties #}

{% set _css_class = 'ecl-fieldset' %}
{% set _extra_attributes = '' %}
{% set _content = content|default('') %}

{# Internal logic - Process properties #}

{% if extra_classes is defined and extra_classes is not empty %}
  {% set _css_class = _css_class ~ ' ' ~ extra_classes %}
{% endif %}

{% if extra_attributes is defined and extra_attributes is not empty and extra_attributes is iterable %}
  {% for attr in extra_attributes %}
    {% set _extra_attributes = _extra_attributes ~ ' ' ~ attr.name ~ '="' ~ attr.value|e ~ '"' %}
  {% endfor %}
{% endif %}

{# Print the result #}

<fieldset class="{{ _css_class }}"{{ _extra_attributes|raw }}>
  {% block fieldset _content %}
</fieldset>
/* No context defined for this component. */
<fieldset class="ecl-fieldset">
</fieldset>
  • Content:
    /**
     * Form Fieldset
     * @define fieldset
     */
    
    // Import base and generic
    @import '@ecl/ec-base/ec-base';
    @import '@ecl/generic-component-form-fieldset/generic-component-form-fieldset';
    
    // Use generic mixin
    @include exports('ec-component-form-fieldset') {
      @include ecl-fieldset();
    }
    
  • URL: /components/raw/ec-component-form-fieldset/ec-component-form-fieldset.scss
  • Filesystem Path: ../../src/systems/ec/ec-component/ec-component-form/ec-component-form-fieldset/ec-component-form-fieldset.scss
  • Size: 285 Bytes
  • Handle: @ecl/ec-component-form-fieldset
  • Tags: atom
  • Preview:
  • Filesystem Path: ../../src/systems/ec/ec-component/ec-component-form/ec-component-form-fieldset/ec-component-form-fieldset.twig