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

Replace comma with code in liquid array

Community Beginner ,
Sep 03, 2015 Sep 03, 2015

Copy link to clipboard

Copied

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

Views

377

Translate

Translate

Report

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

Votes

Translate

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

Copy link to clipboard

Copied

Hello there,

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

and let us know if that works.

Thanks,

M

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

Thanks mstoichi! Appreciate the advice. Works Perfectly!

Votes

Translate

Translate

Report

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