{# /***************************************************************************** File name: amenity-markup.html.twig Project: Villas3 Copyright 2022-2024 Michael J. Miller, All rights reserved Purpose: generate markup for amenities for a villa. To use it villa_id must be set and amenties for the villa must be in array $data['amenities'] that includes the name and id of the category to which the amenity belongs. The list must be sorted by category sequence and amenity sequence. Revision History: Date Version Details Date Version Details -------- - ------- -------------------------------------------- 5/3/23 2.0a2 Added inline style to icon to support color. 9/11/26 4.0b1 Rewritten. Icon presentation now done via a twig macro. Much more straightforward now. ******************************************************************************/ #} {#{% macro icon(icon = "circle-small",#} {# icon_color = "#000000",#} {# icon_color_alt = "#000000",#} {# icon_style = 'regular',#} {# show_default = false#} {# ) %}#} {# #} {# {% if icon is empty and show_default %}#} {# {% set icon = 'circle-small' %}#} {# {% set icon_style = 'solid' %}#} {# {% endif %}#} {# #} {# {% if icon %}#} {# {% if icon_style == 'duotone' %}#} {# #} {# {% else %}#} {# #} {# {% endif %}#} {# {% else %}#} {# #} {# {% endif %}#} {#{% endmacro %}#} {% import "includes/amenity-icon-macro.html.twig" as icon %} {% set cat_name = '' %} {% for amen in amenities %} {% if amen.cat_name != cat_name %} {# start a new category #} {% set cat_name = amen.cat_name %} {% endif %} {% endfor %}