templates/platform/component/_template/_block.html.twig line 1

Open in your IDE?
  1. {% import "@component/_template/_html_macro.html.twig" as macros %}
  2. {% if componentKey is not defined %}
  3. {% set componentKey = '' %}
  4. {% endif %}
  5. {% if isEmpty is not defined %}
  6. {% set isEmpty = false %}
  7. {% endif %}
  8. {% if item_config is not defined %}
  9. {% set item_config = generateComponentOptions(value, componentKey) %}
  10. {% endif %}
  11. {% if customItemClass is not defined %}
  12. {% set customItemClass = '' %}
  13. {% endif %}
  14. {% if customDisplayOverride is not defined %}
  15. {% set customDisplayOverride = true %}
  16. {% endif %}
  17. {% if item_config is not empty
  18. and canDisplayComponentByAcl(item_config)
  19. and customDisplayOverride is same as(true)
  20. %}
  21. {% if isEmpty is same as(false) %}
  22. {#WRAPPER#}
  23. {{ macros.generateHtmlComponentStart(item_config.wrapper) }}
  24. {#ITEM#}
  25. {{ macros.generateHtmlComponentStart(item_config.item, customItemClass) }}
  26. {#CONTAINER#}
  27. {{ macros.generateHtmlComponentStart(item_config.container) }}
  28. {% block component %}{% endblock component %}
  29. {{ macros.generateHtmlComponentEnd(item_config.container) }}{#/CONTAINER#}
  30. {{ macros.generateHtmlComponentEnd(item_config.item) }}{#/ITEM#}
  31. {{ macros.generateHtmlComponentEnd(item_config.wrapper) }}{#/WRAPPER#}
  32. {% else %}
  33. {#WRAPPER#}
  34. {{ macros.generateHtmlComponentStart(item_config.wrapper) }}
  35. {% block displayIfEmpty %}{% endblock %}
  36. {{ macros.generateHtmlComponentEnd(item_config.wrapper) }}{#/WRAPPER#}
  37. {% endif %}
  38. {% endif %}