How can I write a literal expression in liquid inside src={{}}?

Solved

How can I write a literal expression in liquid inside src={{}}?

MariasQuestions
Tourist
6 2 0

Hi!!

 

Could anyone help and suggest how to write literal expression in liquid inside src={{}}. Here is the code:

 

{%- for i in (1..10) -%}
<li>
    <img src="{{ 'fileName-{{ i }}.png' | file_url }}" alt='...' width='...' height='...'>
</li>
{%- endfor -%}

 

Thank you!

Accepted Solution (1)

MariasQuestions
Tourist
6 2 0

This is an accepted solution.

Oh, I got it. It will be not with Literal. Here is the solution:

 

{%- for i in (1..10) -%}
<li>
    <img src="{{ 'team-' | append: i | append: '.png' | file_url }}" alt='...' width='...' height='...'>
</li>
{%- endfor -%}

View solution in original post

Reply 1 (1)

MariasQuestions
Tourist
6 2 0

This is an accepted solution.

Oh, I got it. It will be not with Literal. Here is the solution:

 

{%- for i in (1..10) -%}
<li>
    <img src="{{ 'team-' | append: i | append: '.png' | file_url }}" alt='...' width='...' height='...'>
</li>
{%- endfor -%}