names is a project variable defined as:
names: [‘1’,‘2’,‘3’,‘4’]
For some cases I only want to set the variable to the previous two elements to loop through.
(Index will not work because it relates to source names and it would not compile)
Just wondering if
({% set name = var(‘names’)[0] %}) "
works,
why
{% set name = var(‘names’)[0:1] %}
won’t work.
Doesn’t it work like a normal list?
Do I have to hard code the elements?