You are here

image-effects-set-canvas-summary.html.twig in Image Effects 8.2

Default theme implementation for a summary of set canvas image effect.

Available variables:

  • data: The current configuration for this set canvas effect, including:

    • canvas_color: The canvas color in RGBA format.
    • canvas_size: 'exact' or 'relative'.
    • exact: The configuration for exact size, including:
      • width: the width in px or as % of source image.
      • height: the height in px or as % of source image.
      • placement: The position of the source on the underlying canvas.
      • x_offset: The x_offset of the source image vs placement.
      • y_offset: The y_offset of the source image vs placement.
    • relative: The configuration for relative size, including:
      • left: the size in px of the margin on the left side.
      • right: the size in px of the margin on the right side.
      • top: the size in px of the margin on the top side.
      • bottom: the size in px of the margin on the bottom side.
    • color_info: A render element for canvas color information including a color preview.
  • effect: The effect information, including:
    • id: The effect identifier.
    • label: The effect name.
    • description: The effect description.

File

templates/image-effects-set-canvas-summary.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for a summary of set canvas image effect.
  5. *
  6. * Available variables:
  7. * - data: The current configuration for this set canvas effect, including:
  8. * - canvas_color: The canvas color in RGBA format.
  9. * - canvas_size: 'exact' or 'relative'.
  10. * - exact: The configuration for exact size, including:
  11. * - width: the width in px or as % of source image.
  12. * - height: the height in px or as % of source image.
  13. * - placement: The position of the source on the underlying canvas.
  14. * - x_offset: The x_offset of the source image vs placement.
  15. * - y_offset: The y_offset of the source image vs placement.
  16. * - relative: The configuration for relative size, including:
  17. * - left: the size in px of the margin on the left side.
  18. * - right: the size in px of the margin on the right side.
  19. * - top: the size in px of the margin on the top side.
  20. * - bottom: the size in px of the margin on the bottom side.
  21. * - color_info: A render element for canvas color information including a
  22. * color preview.
  23. * - effect: The effect information, including:
  24. * - id: The effect identifier.
  25. * - label: The effect name.
  26. * - description: The effect description.
  27. *
  28. * @ingroup themeable
  29. */
  30. #}
  31. {% spaceless %}
  32. {% if data.canvas_size == 'exact' %}
  33. - {{ 'Exact size'|t }}:
  34. {% if data.exact.width %}{{ data.exact.width|e }}{% else %}{{ '100%'|t }}{% endif %}x{% if data.exact.height %}{{ data.exact.height|e }}{% else %}{{ '100%'|t }}{% endif %}
  35. {{ 'Placement'|t }}: {{ data.exact.placement|e }}
  36. {% if data.exact.x_offset %} {{ 'X offset'|t }}: {{ data.exact.x_offset|e }}px{% endif %}
  37. {% if data.exact.y_offset %} {{ 'Y offset'|t }}: {{ data.exact.y_offset|e }}px{% endif %}
  38. {% elseif data.canvas_size == 'relative' %}
  39. - {{ 'Relative size'|t }}:
  40. {% if data.relative.left %} {{ 'left'|t }}: {{ data.relative.left|e }}px{% endif %}
  41. {% if data.relative.right %} {{ 'right'|t }}: {{ data.relative.right|e }}px{% endif %}
  42. {% if data.relative.top %} {{ 'top'|t }}: {{ data.relative.top|e }}px{% endif %}
  43. {% if data.relative.bottom %} {{ 'bottom'|t }}: {{ data.relative.bottom|e }}px{% endif %}
  44. {% endif %}
  45. - {{ 'Color'|t }}: {{ data.color_info }}
  46. {% endspaceless %}