Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Uploading images for onmouseout and onmouseover View modes: 
User avatar
Member
Member
shelley.ford-celero - 2/4/2013 7:35:14 PM
   
Uploading images for onmouseout and onmouseover
Hi,
Our designer created code as follows:
<a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image10','','images/SMtwitter-on.gif',1)"><img src="images/SMtwitter-off.gif" alt="Our Twitter Page" width="26" height="26" id="Image10" /></a>

We built a document type where the user can upload both the "on" (hover) image and the "off" image as well as entering the URL for the image. The upload is a direct uploader form control to upload the two images.

I wanted to use the following code for the transformation:
<a href="<%# Eval("LinkURL") %>" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image<%# Eval("SocialMediaLinkID") %>','','<%#GetImage("HoverImage")%>',1)">
<%#GetImage("LinkImage")%></a>

However, it errors on the GetImage() in the onmouseover. And I need to match the image id in the onmouseover to the image id in the <img> tag.

The only way I was to solve this was to use the following:
<a href="<%# Eval("LinkURL") %>" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image<%# Eval("SocialMediaLinkID") %>','','<%#GetFileUrl("HoverImage")%>',1)">
<img src='<%#GetFileUrl("LinkImage")%>' id='Image<%# Eval("SocialMediaLinkID") %>' alt='<%#Eval("") %> /> </a>

With this solution though we can't take advantage of the direct uploader's ability to set the image title property. Do you have any suggestions?

User avatar
Certified Marketer 12
Certified Marketer 12
Ilesh Mistry (MMT Digital's K-Team) - 2/5/2013 4:52:40 AM
   
RE:Uploading images for onmouseout and onmouseover
Hello

If you wish to set the Image title property, do you have another field on the Document Type e.g. Image Name? If so you could use this.
Alternatively you could add a new field in the Document Type for the Image Title.

Thanks

Ilesh Mistry from MMT Digital's K-Team
Kentico Certified Developer

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 2/7/2013 4:08:49 AM
   
RE:Uploading images for onmouseout and onmouseover
Hello,

Could you also please tell us which error message are you exactly getting?

Best regards,
Martin Danko