0

我想在选择框中插入一个 CSS 类。Powermail 怎么可能做到这一点?

TCEFORM {
  tx_powermail_domain_model_form {
    css {
      addItems {
        newCssClass = new-class
      }
    }
  }
  tx_powermail_domain_model_page < .tx_powermail_domain_model_form
  tx_powermail_domain_model_field < .tx_powermail_domain_model_form
}

有人可以帮忙吗?

4

1 回答 1

1

覆盖选择的部分。

在 TypoScript 中

plugin.tx_powermail {
    view {
        partialRootPath >
        partialRootPaths {
            10 = EXT:powermail/Resources/Private/Partials/
            20 = EXT:yourextension/Resources/Private/Partials/
        }
    }
}

EXT:yourextension/Resources/Private/Partials/Form/Field/Select.html

{namespace vh=In2code\Powermail\ViewHelpers}

<div class="powermail_fieldwrap powermail_fieldwrap_type_select powermail_fieldwrap_{field.marker} {field.css} {settings.styles.framework.fieldAndLabelWrappingClasses}">
    <label for="powermail_field_{field.marker}" class="{settings.styles.framework.labelClasses}" title="{field.description}">
        <vh:string.RawAndRemoveXss>{field.title}</vh:string.RawAndRemoveXss><f:if condition="{field.mandatory}"><span class="mandatory">*</span></f:if>
    </label>
    <div class="{settings.styles.framework.fieldWrappingClasses}">
        <vh:Form.SelectField
                options="{field.modifiedSettings}"
                property="{field.marker}"
                class="new-class powermail_select {settings.styles.framework.fieldClasses} {vh:Validation.ErrorClass(field:field, class:'powermail_field_error')}"
                id="powermail_field_{field.marker}"
                additionalAttributes="{vh:Validation.ValidationDataAttribute(field:field)}"
                multiple="{field.multiselectForField}"
                value="{vh:Misc.PrefillField(field:field, mail:mail)}" />

        <f:if condition="{field.multiselect}">
            <f:if condition="{settings.validation.client}">
                <div class="powermail_field_error_container powermail_field_error_container_{field.marker}"></div>
            </f:if>
        </f:if>
    </div>
</div>
于 2019-05-11T18:21:36.170 回答