Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > MenuItemTeaserImages GUID returns null View modes: 
User avatar
Member
Member
nirmalh-mindfiresolutions - 11/26/2010 8:09:39 AM
   
MenuItemTeaserImages GUID returns null
Hi,
I tried to transform the images from the CMS.MenuItem.ImagesGallery. The images stored in MenuItemTeaserImages.

Trying to get the images like
<a href="<%# GetDocumentUrl() %>">
<img class="teaser" src="<%# GetFileUrl("MenuItemTeaserImage") %>" alt="<%# Eval("DocumentName") %>" />
</a>
<h5><%# Eval("DocumentName") %></h5>


But I am getting the scr url as
http://localhost/KenticoCMS/getattachment/00000000-0000-0000-0000-000000000000/mypage---Trays.aspx

Why the GUID is 0 ? This is ending up with "No Image Found".

Please suggest if I am doing anything wrong.

Thanks,
Nirmal


User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 11/26/2010 8:31:54 AM
   
RE:MenuItemTeaserImages GUID returns null
Hi,

I am not sure if you are using CMS.MenuItem or CMS.ImageGallery document type.

Following code generates relative url to teaser image for CMS.ImageGallery document.

<%# GetImage("GalleryTeaserImage") %>


You can modify the column name according your document type - you can find code name of this column in the Site Manager - Development - Document types - your_type - Fields - your field - Attribute name.

Best regards,
Ivana Tomanickova

User avatar
Member
Member
chrishaff-gmail - 8/28/2011 8:39:34 AM
   
RE:MenuItemTeaserImages GUID returns null
I am having the exact same issue as the previous poster. I am using the CMS.MenuItem document type. The settings for it's "MenuItemTeaserImage" field are the same as for "GalleryTeaserImage" in your example.

I am using this in a repeater that's nothing fancy, just showing /Home/%.

Like for the other poster the core "document" data is coming back correctly, but the GUID for the image is all 0s.

User avatar
Member
Member
chrishaff-gmail - 8/28/2011 8:43:44 AM
   
RE:MenuItemTeaserImages GUID returns null
Oh, just in case it's not implicit the code is the the transform the repeater uses. Here'e the code:
<a class="tile" href="<%# GetDocumentUrl() %>">
<%# GetImage("MenuItemTeaserImage", 55, 55) %><br />
<div class="iconLabel"><%# Eval("DocumentName") %></div>
</a>


User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 8/29/2011 8:24:24 AM
   
RE:MenuItemTeaserImages GUID returns null
Hi,

I tested your code (Firefox 3.6) and image was displayed correctly. But if you insert <div> into <a> tag your code will not be valid - therefore the image may not be displayed correctly in some browsers.

If you need to create a clickable block you can do it using css <a style="display: block;"><span style="display: block;">

The <span> can be used inside <a> tag.

For testing purposes, could you please try to use following code instead:

<a class="tile" href="<%# GetDocumentUrl() %>">
<%# GetImage("MenuItemTeaserImage", 55, 55) %>
</a>
<br />
<div class="iconLabel"><%# Eval("DocumentName") %></div>


Best regards,
Ivana Tomanickova