diff --git a/src/Frontend/Modules/Quotes/Layout/Templates/Quote.html.twig b/src/Frontend/Modules/Quotes/Layout/Templates/Quote.html.twig new file mode 100644 index 0000000..f457a13 --- /dev/null +++ b/src/Frontend/Modules/Quotes/Layout/Templates/Quote.html.twig @@ -0,0 +1,15 @@ +{% macro quote(quote) %} +
+
+ {% if quote.image %} +
+ {{ quote.name }} +
+ {% endif %} +
+ {{ quote.quote|raw }} + {{ quote.name }} +
+
+
+{% endmacro %} diff --git a/src/Frontend/Modules/Quotes/Layout/Widgets/AllQuotes.html.twig b/src/Frontend/Modules/Quotes/Layout/Widgets/AllQuotes.html.twig index 203f88c..a10bc24 100644 --- a/src/Frontend/Modules/Quotes/Layout/Widgets/AllQuotes.html.twig +++ b/src/Frontend/Modules/Quotes/Layout/Widgets/AllQuotes.html.twig @@ -1,4 +1,7 @@ -{% for quote in quotes %} -
{{ quote.quote|raw }}
-

{{ quote.name }}

-{% endfor %} +{% import 'Modules/Quotes/Layout/Templates/Quote.html.twig' as quotesTemplates %} + +
+ {% for quote in quotes %} + {{ quotesTemplates.quote(quote) }} + {% endfor %} +
diff --git a/src/Frontend/Modules/Quotes/Layout/Widgets/RandomQuote.html.twig b/src/Frontend/Modules/Quotes/Layout/Widgets/RandomQuote.html.twig index 4e98f4f..fc97f75 100644 --- a/src/Frontend/Modules/Quotes/Layout/Widgets/RandomQuote.html.twig +++ b/src/Frontend/Modules/Quotes/Layout/Widgets/RandomQuote.html.twig @@ -1,23 +1,7 @@ -{% if quote %} -
-
- {% if quote.image %} -
- {{ quote.name }} -
-
- {{ quote.quote|raw }} - -- {{ quote.name }} -
- {% endif %} - - {% if not quote.image %} -
- {{ quote.quote|raw }} - -- {{ quote.name }} -
- {% endif %} -
-
-{% endif %} +{% import 'Modules/Quotes/Layout/Templates/Quote.html.twig' as quotesTemplates %} +
+ {% if quote %} + {{ quotesTemplates.quote(quote) }} + {% endif %} +
diff --git a/src/Frontend/Modules/Quotes/Layout/Widgets/SingleQuote.html.twig b/src/Frontend/Modules/Quotes/Layout/Widgets/SingleQuote.html.twig index 9435343..d703ce8 100644 --- a/src/Frontend/Modules/Quotes/Layout/Widgets/SingleQuote.html.twig +++ b/src/Frontend/Modules/Quotes/Layout/Widgets/SingleQuote.html.twig @@ -1,22 +1,7 @@ -{% if quote %} -
-
- {% if quote.image %} -
- {{ quote.name }} -
-
- {{ quote.quote|raw }} - -- {{ quote.name }} -
- {% endif %} - - {% if not quote.image %} -
- {{ quote.quote|raw }} - -- {{ quote.name }} -
- {% endif %} -
-
-{% endif %} +{% import 'Modules/Quotes/Layout/Templates/Quote.html.twig' as quotesTemplates %} + +
+ {% if quote %} + {{ quotesTemplates.quote(quote) }} + {% endif %} +