Lava Shortcode - Rock Control

Description

Base control shortcode used for Helix-based UI components.

Documentation

Example Usage

{[ rockcontrol label:'My Control' type:'data-text-box' isrequired:'true' validationmessage:'Please enter a value.' ]}
{[ endrockcontrol ]}
Parameters

The following parameters are available for configuration.

  • id - This is the identifier that will be used for the control. If one is not provided a unique one will be created for you with the pattern of rc-{guid}.
  • label (Campus) - The label to display above the control.
  • showlabel (true) - Whether or not to display a label.
  • controltype - The type of control. This is appended to the root form-group.
  • isrequired (false) - Establishes whether making a selection is necessary.
  • validationmessage - Message to display when the value is not valid.
Notes on Usage
  • This shortcodes provided theid Lava merge field available to the rendering of the inner content.

Markup

{% assign isrequired = isrequired | AsBoolean %}
{% assign showlabel = showlabel | AsBoolean %}

<div class="form-group {{ controltype }} {% if isrequired %}required{% endif %}">
    {% if showlabel %}
        <label class="control-label" for="{{ id }}">{{ label }}</label>
    {% endif %}
    <div class="control-wrapper">
        {{ blockContent }}
    </div>
    {% if isrequired %}
        <span id="rfv-{{ id }}" class="validation-error help-inline" style="display:none;">{{ validationmessage }}</span>
    {% endif %}
</div>