Question

1
Replies
149
Views
AshishK6140 Member since 2015 12 posts
Tata Consultancy Services
Posted: 8 months ago
Last activity: 8 months ago

How to set image name dynamically in HTML

I am using the below code to set the image in HTML and later displaying it in the section:

<html>

<head>

<title>QR Test</title>

<style type="text/css">

   div.boxed { border-style: solid; }

  </style>

  </head>

  <body>

  <div class='boxed'>

    <img src='<pega:contentURL name="TestQRCode.png" path="/qrcode/" classType="Image"/>' >

  </div>

  </body>

  </html>

 

But I have to pass the image name dynamically. So I used the below code :

<html>

<head>

  <title>QR Test</title>

  <style type="text/css">

   div.boxed { border-style: solid; }

  </style>

  </head>

  <body>

  <div class='boxed'>

    <img src='<pega:contentURL name=<%= tools.findPage("pyWorkPage").getProperty(".Property1").getStringValue()%> path="/qrcode/" classType="Image"/>' >

  </div>

  </body>

  </html>

 

But I am getting the below error: 

content of stream definition—

An expected quote character is not found after attribute name.

Could you please help me so that I can pass the image name dynamically

 

Pega Configure Price Quote for Communications 8.2 Low-Code App Development Dev/Designer Studio Communications and Media Senior System Architect
Share this page LinkedIn