Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
Locked
0

Replace comma with code in liquid array

Community Beginner ,
Sep 03, 2015 Sep 03, 2015

Hey Folks,

I might even have the wrong terminology but i'm stumped with this issue.

I have an array from a listbox web app item which out puts the following liquid on the DETAIL page:

"Fuel Products": "Diesel (high flow),Regular ULP,Premium ULP",

I'm wanting to switch the commas in the array with a font icon eg:

<span class="fa fa-check"></span>

I was trying to use the "Replace" filter but that's not working. And i tried using "capture" but clearly there is some funky coding that i've completely missed. Please help..

{% capture checkMark -%}<span class="fa fa-check"></span>{% endcapture -%}

{{this.['Fuel Products'] | replace: ",", "{{checkMark}}"}}

Cheers

James - RelianceIT

TOPICS
Developer
438
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Employee , Sep 03, 2015 Sep 03, 2015

Hello there,

Try {{this.['Fuel Products'] | replace: ",", checkMark}}

and let us know if that works.

Thanks,

M

Translate
Adobe Employee ,
Sep 03, 2015 Sep 03, 2015

Hello there,

Try {{this.['Fuel Products'] | replace: ",", checkMark}}

and let us know if that works.

Thanks,

M

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 03, 2015 Sep 03, 2015

Yeah once you're inside liquid such as {{ }} or {% %} you don't need to nest {{ }} or {% %} again in order to reference another variable - as mstoichi explained.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 03, 2015 Sep 03, 2015
LATEST

Thanks mstoichi! Appreciate the advice. Works Perfectly!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines