ASPX templates
Version 5.x > ASPX templates > SEO for Images issue View modes: 
User avatar
Member
Member
t_a_maria-yahoo - 10/6/2010 9:55:27 AM
   
SEO for Images issue
I am working at the SEO for my company website, build using Kentico. In some of the pages, like http://www.isdc.eu/About-us/LeadershipTeam.aspx I have a lightbox showing some Person document types. The problem is that the image of the person not searchable by search engines, e.g. Google.

In my custom person document type, the image file type is “Upload File”.
In the transformation I am using GetFileUrl in order to be able to add also alt and title attributes, but still the image is not searchable.

Is this because by using
<%# GetFileUrl("PictureAttributeName")%>
, the src is something like /getattachment/f6bd5be0-01df-4acc-9598-83defb1a8924/PersonName.aspx ?

Should I place all person photos in a MediaLibrary folder and in the person “Form View only to link to it? If Yes haw can I do this?


User avatar
Member
Member
kentico_michal - 10/8/2010 7:21:04 AM
   
RE:SEO for Images issue
Hi,

I would recommend you to upload photos into media library at first (http://devnet.kentico.com/docs/devguide/index.html?creating_media_libraries.htm) and then use Media selection field type instead of file Upload file to insert photo into PictureAttributeName field of custom document.

You could then use following method to get URL of the file in transformation

<%# CMS.GlobalHelper.UrlHelper.ResolveUrl(Eval("PictureAttributeName").ToString().Split('?')[0]) %>

As a result this method returns link to file.jpg in following format, that is certainly more SEO friendly:

~/MySite/Media/MyLibrary/file.jpg


It is also necessary to set Use permanent URLs property to false (Site Manager -> Settings -> Media Libraries -> Use permanent URLs)

Best regards,
Michal Legen

User avatar
Member
Member
t_a_maria-yahoo - 10/8/2010 9:32:49 AM
   
RE:SEO for Images issue
Hi,

Thanks for your answer, I succeeded to use media links, but I still have a problem.
The Images returned were like
/getmedia/6c6d127d-d4cd-43f8-9d88-99a2562ba5e5/Theo-Punter.gif.aspx
I did unchecked "Use Permanent URL" in Media library settings
Do you have any idea why?

Code in Transpormation:
<img src="<%# CMS.GlobalHelper.UrlHelper.ResolveUrl(Eval("PictureSmallMediaLink").ToString().Split('?')[0]) %>" title="<%# Eval("FirstName") %> <%# Eval("LastName") %>" alt="<%# Eval("FirstName") %> <%# Eval("LastName") %>" onmouseover="this.src='<%# CMS.GlobalHelper.UrlHelper.ResolveUrl(Eval("PictureGreyMediaLink").ToString().Split('?')[0])%>'"
onmouseout="this.src='<%# CMS.GlobalHelper.UrlHelper.ResolveUrl(Eval("PictureSmallMediaLink").ToString().Split('?')[0])%>'"
/>,

Resulted html:
<img onmouseout="this.src='/getmedia/6c6d127d-d4cd-43f8-9d88-99a2562ba5e5/Theo-Punter.gif.aspx'" onmouseover="this.src='/getmedia/39bf56f7-847c-4992-8369-7ad502259ce3/Theo-Punter_grey.gif.aspx'" alt="Theo Punter" title="Theo Punter" src="/getmedia/6c6d127d-d4cd-43f8-9d88-99a2562ba5e5/Theo-Punter.gif.aspx">

Thanks,
Kind regards,
Maria

User avatar
Member
Member
kentico_michal - 10/14/2010 8:30:14 AM
   
RE:SEO for Images issue
Hi,

Could you please confirm that you are using Media selection field type and you had uploaded image into media library before you inserted it into this field?

Moreover, which version of Kentico CMS are you using?

Best regards,
Michal Legen

User avatar
Member
Member
t_a_maria-yahoo - 10/14/2010 10:47:12 AM
   
RE:SEO for Images issue
Hi, I found the solution thanks to kentico team support.
The problem was that I uploaded the images when the option "Use permanent URLs" was on. If I re-uploaded the in the media gallery when the option is off and then re-attached the media link objects then the link was correct.