Skip to main content
pankajk
September 3, 2024
Solved

DOCX From Template display Image conditionally

  • September 3, 2024
  • 4 replies
  • 0 views

Using plugin DOCX From Template to generate word doc and using image bookmark to display image, how can we display image conditionally, it should display image if i pass any image data from PM.

Best answer by somasundaram.d

[mention:0ed83194bfa249d6923ad81b1a81d091:e9ed411860ed4f2ba0265705b8793d05] 

Try adding the below conditional logic

4 replies

justinw59
September 3, 2024

Can you see if IF statements work? freemarker.apache.org/.../ref_directive_if.html

In this example below, you could add a flag to your data model ("<showImage>true</showImage>") and then try wrapping the image list? Unfortunately, I've only been able to verify this with simple text - the plugin is giving me problems with the image input at the moment, so I haven't been able to test with your exact scenario.

somasundaram.d
September 4, 2024

[mention:0ed83194bfa249d6923ad81b1a81d091:e9ed411860ed4f2ba0265705b8793d05] 

Try adding the below conditional logic

pankajk
pankajkAuthor
September 4, 2024

Thanks Somasundaram it worked.