I am trying to use Twig methods/loops while working on a design/template. To avoid touching the CP or the DB i did set variables directly in the template, like :
{% set service =
{
'titel':
[
'Titel1',
'Titel2'
],
}
%}
{% for i in 0..1 %}
<p>{{ service.headerQuote }}</p>
{% endfor %}
It would be much better to be able to use the standard Craft methods, so if I move from templating/designing towards the DB i wouldn't have to touch the methods in my markup. Unfortunately, I can't make it work... I tried:
{% set service = { titel:
[
'hallo',
'hallo2'
]
}
%}
{% for entry in craft.entries
.section('service') %}
<p>{{ entry.titel }}</p>
{% endfor %}
I tried to set the service entry to craft.entries.section('service') but that doesn't work as well... what am I missing?
Is it even possible to overwrite Craft variables in the markup?