Anyone know how to target a Loop & Merge field (e.g., ${lm://Field/2}) with CSS? | XM Community
Solved

Anyone know how to target a Loop & Merge field (e.g., ${lm://Field/2}) with CSS?

  • 22 July 2020
  • 1 reply
  • 42 views

tl;dr
Is there some custom CSS code I can insert in the Look & Feel area that would target every occurrence of ${lm://Field/2} in my survey?
(If I used the Rich Content Editor, it would take me a very long time and I want to be able to change my mind about the color I want to turn every occurrence of ${lm://Field/2}.)
Thanks! 😀

Background
I have a survey with a block of questions the respondent answers about each of their children (whose names they've enumerated in a previous block). I've implemented a Loop & Merge for this purpose, and it works. In each question in the block, the "current" child's name appears so that the respondent is always clear about which child they're answering about at the moment. An example of a question's text is:
How would you rate ${lm://Field/2}'s athletic ability?
And with each loop, the children's names stored in the Loop & Merge's Field2 appear appropriately. Now I just want to be able to style them in one fell swoop.
Thanks!






icon

Best answer by SurajK 22 July 2020, 20:40

View original

1 reply

Userlevel 5
Badge +4

You can add ${lm://Field/2} in some span class with a proper class name and using that class you can adjust the CSS on overall basis.
${lm://Field/2}
In look & feel, you can add the css,
.childname{color:red;}

Leave a Reply