AnsweredAssumed Answered

Velocity: " makes a reference treated as a literal in an <a> tag

Question asked by Grégoire Michel on Mar 22, 2017
Latest reply on Mar 22, 2017 by Grégoire Michel

Hi all,

 

I am using the following code:

 

#set($downloadLink={

  "BPDCS":{

  "title":"BPD Case Study",

  "link":"http://infos.inficiences.com/rs/593-IYJ-660/images/Inficiencespartners-casestudy-bpd-digitalisation-marketing-systeme-information-marketing-commercial.pdf"

  },

  "DACS":{

  "title":"Deny All Case Study",

  "link":"http://infos.inficiences.com/rs/593-IYJ-660/images/Inficiencespartners-casestudy-denyall-marketing-automation.pdf"

  },

    "IVCS":{

  "title":"Infovista Case Study",

  "link":"http://infos.inficiences.com/rs/593-IYJ-660/images/Inficiencespartners-casestudy-infovista-systeme-information-marketing.pdf"

  },

  "EBSCS":{

  "title":"ESSEC Case Study",

  "link":"http://infos.inficiences.com/rs/593-IYJ-660/images/Inficiencespartners-casestudy-essec-conception-deploiement-strategie-acquisition-nurturing.pdf"

  },

  "KDSCS":{

  "title":"KDS Case Study",

  "link":"http://infos.inficiences.com/rs/593-IYJ-660/images/Inficiencespartners-casestudy-kds-nouvelles-pratiques-generation-demande-automatisee.pdf"

  }

})

<ul>

#foreach ($key in $lead.downloadcenter.split("[;]"))

#set ($key = ${key.trim()})

      <li><a href="${downloadLink.get($key).link}" target="_blank" class="mktNoTrack">$downloadLink.get($key).title</a> : $downloadLink.get($key).link</li>

#end

</ul>

 

The second call to $downloadLink.get($key).link displays the URL OK. But the first one in the href returns an error when we click the link.

 

For those who want to see it working, try this form: inficiences

 

Any help is welcome

 

-Greg

Outcomes