From f33ef3ba99ea8873fe4d0ce432ddf23cc4e6f396 Mon Sep 17 00:00:00 2001 From: Ivo Valchev Date: Mon, 24 Aug 2020 16:00:39 +0200 Subject: [PATCH 1/6] Test setcontent for DBs without json_extract --- public/theme/skeleton/custom/setcontent_1.twig | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/public/theme/skeleton/custom/setcontent_1.twig b/public/theme/skeleton/custom/setcontent_1.twig index 71668728b..c3407c259 100644 --- a/public/theme/skeleton/custom/setcontent_1.twig +++ b/public/theme/skeleton/custom/setcontent_1.twig @@ -172,4 +172,14 @@ {% endfor %} + +
+

Twelve

+ {% setcontent about = 'blocks/aboout' %} + +
{% endblock main %} From 25e0ba71b4a200f27effe4363ecacddc0dafb2a5 Mon Sep 17 00:00:00 2001 From: Ivo Valchev Date: Tue, 25 Aug 2020 14:32:49 +0200 Subject: [PATCH 2/6] Fix test --- public/theme/skeleton/custom/setcontent_1.twig | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/public/theme/skeleton/custom/setcontent_1.twig b/public/theme/skeleton/custom/setcontent_1.twig index c3407c259..d13994549 100644 --- a/public/theme/skeleton/custom/setcontent_1.twig +++ b/public/theme/skeleton/custom/setcontent_1.twig @@ -155,7 +155,7 @@ {% endfor %} @@ -175,10 +175,12 @@

Twelve

- {% setcontent about = 'blocks/aboout' %} + {% setcontent about = 'blocks/about' %}
    - {% if about.title != 'About This Site' %} -
  • no
  • + {% if about.title == 'About This Site' %} +
  • {{ about.title }} [yes]
  • + {% else %} +
  • [no]
  • {% endif %}
From 69ebde370e72b2ab103ede2f00ef5867728da2f0 Mon Sep 17 00:00:00 2001 From: Ivo Valchev Date: Tue, 25 Aug 2020 16:14:56 +0200 Subject: [PATCH 3/6] Update setcontent_1.twig --- public/theme/skeleton/custom/setcontent_1.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/theme/skeleton/custom/setcontent_1.twig b/public/theme/skeleton/custom/setcontent_1.twig index d13994549..e2bc70518 100644 --- a/public/theme/skeleton/custom/setcontent_1.twig +++ b/public/theme/skeleton/custom/setcontent_1.twig @@ -155,7 +155,7 @@ {% endfor %}
    -
  • Two different random results: [{{ first_ids === second_ids ? "[no]" : "[yes]" }}]
  • +
  • Two different random results: {{ first_ids === second_ids ? "[no]" : "[yes]" }}
From 9ff76e3a432a67cf62da0cbabeea2e05275868d7 Mon Sep 17 00:00:00 2001 From: Ivo Valchev Date: Mon, 24 Aug 2020 16:00:39 +0200 Subject: [PATCH 4/6] Test setcontent for DBs without json_extract --- public/theme/skeleton/custom/setcontent_1.twig | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/public/theme/skeleton/custom/setcontent_1.twig b/public/theme/skeleton/custom/setcontent_1.twig index 88c3852ab..a919f7e42 100644 --- a/public/theme/skeleton/custom/setcontent_1.twig +++ b/public/theme/skeleton/custom/setcontent_1.twig @@ -178,4 +178,14 @@ {% endfor %} + +
+

Twelve

+ {% setcontent about = 'blocks/aboout' %} +
    + {% if about.title != 'About This Site' %} +
  • no
  • + {% endif %} +
+
{% endblock main %} From b37349ed3d4d33561b9f4dafc3728bc06901b55c Mon Sep 17 00:00:00 2001 From: Ivo Valchev Date: Tue, 25 Aug 2020 14:32:49 +0200 Subject: [PATCH 5/6] Fix test --- public/theme/skeleton/custom/setcontent_1.twig | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/public/theme/skeleton/custom/setcontent_1.twig b/public/theme/skeleton/custom/setcontent_1.twig index a919f7e42..5ec85145e 100644 --- a/public/theme/skeleton/custom/setcontent_1.twig +++ b/public/theme/skeleton/custom/setcontent_1.twig @@ -160,7 +160,7 @@ {% endfor %}
    -
  • Two different random results: [{{ first_ids === second_ids ? "no" : "yes" }}]
  • +
  • Two different random results: [{{ first_ids === second_ids ? "[no]" : "[yes]" }}]
@@ -181,10 +181,12 @@

Twelve

- {% setcontent about = 'blocks/aboout' %} + {% setcontent about = 'blocks/about' %}
    - {% if about.title != 'About This Site' %} -
  • no
  • + {% if about.title == 'About This Site' %} +
  • {{ about.title }} [yes]
  • + {% else %} +
  • [no]
  • {% endif %}
From a18e3817f9b9eb855c1fe2903dd7a8788c574fb4 Mon Sep 17 00:00:00 2001 From: Ivo Valchev Date: Wed, 26 Aug 2020 09:15:25 +0200 Subject: [PATCH 6/6] allow tests for like statement to be case insensitive --- public/theme/skeleton/custom/setcontent_1.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/theme/skeleton/custom/setcontent_1.twig b/public/theme/skeleton/custom/setcontent_1.twig index 5ec85145e..e82e4b335 100644 --- a/public/theme/skeleton/custom/setcontent_1.twig +++ b/public/theme/skeleton/custom/setcontent_1.twig @@ -9,7 +9,7 @@ {% endmacro %} {% macro contains(needle, haystack) %} - {% if needle in haystack %}[yes]{% else %}[no]{% endif %} + {% if needle|lower in haystack|lower %}[yes]{% else %}[no]{% endif %} {% endmacro %} {% block main %} @@ -124,7 +124,7 @@ {% for entry in entries %}
  • {{ entry.contenttype }} {{ entry.id }} . {{ entry|title }} - {% if 'voluptat' in entry|title or 'porro' in entry|title %}[yes]{% else %}[no]{% endif %} + {% if 'voluptat' in entry|title|lower or 'porro' in entry|title|lower %}[yes]{% else %}[no]{% endif %}
  • {% set last = entry.id %} {% endfor %}