v1/web/themes/custom/martis/templates/commerce/commerce-product-attribute-...

30 lines
796 B
Twig

{#
/**
* @file
*
* Default template for product attribute values.
*
* Available variables:
* - attributes: HTML attributes for the wrapper.
* - product_attribute_value: The rendered product attribute value fields.
* Use 'product_attribute_value' to print them all, or print a subset such as
* 'product_attribute_value.name'. Use the following code to exclude the
* printing of a given field:
* @code
* {{ product_attribute_value|without('name') }}
* @endcode
* - product_attribute_value_entity: The product attribute value entity.
*
* @ingroup themeable
*/
#}
{%
set classes = [
'product-attribute',
'product-attribute--' ~ product_attribute_value_entity.bundle|clean_class,
]
%}
<div{{ attributes.addClass(classes) }}>
{{- product_attribute_value -}}
</div>