Expected end_of_string - I am trying to concatenate liquid in a string

Liquid syntax error (line 8): Expected end_of_string but found id in “{{‘style="background-image: url(’ block.settings.step_corner_image | img_url: ‘200x200’ ')”’ }}"

Here is my code:

{%- assign inlineStyle = 'style="background-image: url(' block.settings.step_corner_image | img_url: '200x200' ')"' -%}

Hi @boyjarv ,

I am not sure what are you trying to obtain? you are assigning some inlineStyle?

You can just directly put the code to the div, please refer to the code below.


Contents here....

Thanks but to be cleaner with my coding I’d like it as a variable, surely it’s possible

I just fixed it:

{%- assign cornerImg = block.settings.step_corner_image | img_url: '200x200' -%}
    {%- assign inlineStyle = 'style="background-image: url(' | append: cornerImg | append: ');"' -%}

@boyjarv

I am surprise that this code works for you. There is always a first time :blush: