<tal:block i18n:domain="nive"
      tal:define="fieldw field.widget; formw field.widget.form.widget">

    <div tal:condition="fieldw.hidden"
             tal:content="structure field.serialize(cstruct)">
    </div>

    <div tal:condition="not fieldw.hidden"
            id="item-${field.name}"
            class="row form-group ${field.error and (fieldw.error_class)}">

        <tal:block tal:condition="fieldw.category!='full-width'">
            <!-- mapping_item 3 column -->
            <label tal:condition="fieldw.category != 'structural'"
                     tal:content="field.title"
                    class="col-form-label ${formw.settings.get('column1_css', 'col-md-2')} ${'required' if field.required else ''} ${field.error and (fieldw.error_class)}"
                    for="${field.oid}"></label>

            <div class="${formw.settings.get('column2_css', 'col-md-7')}">
                <span tal:replace="structure field.serialize(cstruct)"/>
                <div tal:condition="field.error">
                    <div tal:repeat="msg field.error.messages()" class="invalid-feedback">${msg}</div>
                </div>
            </div>
            <div class="${formw.settings.get('column3_css', 'col-md-3')}">
                <div tal:content="structure field.description" class="help-block"></div>
            </div>
            <!-- /mapping_item -->
        </tal:block>

        <tal:block tal:condition="fieldw.category=='full-width'">
            <!-- mapping_item 3 full width -->
            <div class="col-sm">
                <label tal:condition="fieldw.category != 'structural'"
                         tal:content="field.title"
                        class="col-form-label ${'required' if field.required else ''} ${field.error and (fieldw.error_class)}"
                        for="${field.oid}"></label>
            </div>
            <div class="col-sm">
                <span tal:replace="structure field.serialize(cstruct)"/>
                <span tal:condition="field.error"
                         tal:repeat="msg field.error.messages()"
                        class="help-inline">${msg}</span>
            </div>
            <div class="col-sm">
                <div tal:content="structure field.description" class="help-block"></div>
            </div>
            <!-- /mapping_item -->
        </tal:block>

    </div>

</tal:block>