Jump to content

Recommended Posts

Just now, Mylene said:

Hi,

I need to display needed image in html block on the results page depending on a value in a field.

I placed files into app parameters, however, it seems that I cannot create correct syntax.

If someone faced the same challenge, please help!

I have a solution for this case. 

<script>

var x = '[@field:field_with_values]';
if (x==100){
document.write('<img  src="[@app:img1/]" style="width: 415px; height: 566px; margin: 1px;" />');
}
else{
document.write('<img  src="[@app:img2/]" style="width: 415px; height: 566px; margin: 1px;" />');
}

</script>

In my script:

 [@field:check_for_image] - field which is used for the condition.

[@app:img1/] - is the first image

[@app:img2/] - is the second image

Image 1 appears when field with values=100, in other cases appears image2

Hope that helps :)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...