ASPX templates
Version 6.x > ASPX templates > Help: Using Repeater to show Image View modes: 
User avatar
Member
Member
hungquang_itsyad-yahoo.com - 5/16/2012 3:00:51 AM
   
Help: Using Repeater to show Image
Hi,

I using cmsrepeater to show Image for Banner

<cms:CMSRepeater runat="server" ID="rptBanner" ClassNames="TrinhTham.ThietLapGiaoDien" Path="/Thiet-lap-giao-dien/CONG-TY-DICH-VU-CUNG-CAP-THONG-TIN-TRINH-THAM">
<ItemTemplate>
<img alt="Banner Trinh Tham" src="<%#Eval("Banner","/getattachment/{0}/img.aspx?") %>"/>
</ItemTemplate>
</cms:CMSRepeater>

but it is very slow and I cant see Image banner are loading

When I show Image by using direc link to Image:
<img src="../../App_Themes/TrinhTham/Images/banner.jpg" alt=""/>

it very fast and I can't see Image banner load.

Have any way to improve the speed when I show Image by using cmsRepeater?




Thank!

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 5/16/2012 5:33:34 AM
   
RE:Help: Using Repeater to show Image
Hi,

would you like to display some project folder image (from App_Themes folder) or some image which was inserted in document (in the Banner field)?

2. What kind of form control was used for Banner field? In case this fields stores GUID you can use following code in your transformation:
<%# GetImage("NewsTeaser") %>

3. The above code should be inserted in transformation which is used by your repeater control:
Configuration of cmsrepeater control

4. The repeater web part only renders image. It does not have any slider functionality. For this you would need to use content slider or some other web part.

Best regards,
Ivana Tomanickova

User avatar
Member
Member
hungquang_itsyad-yahoo.com - 5/16/2012 9:50:44 AM
   
RE:Help: Using Repeater to show Image
I using aspx template, I don't use any webpart.

In.aspx file, I wrote:

<cms:CMSRepeater runat="server" ID="cmsRptbanner" Path="/Banner/%" ClassNames="CMS.File" EnableViewState="false" SelectedColumns="FileAttachment">
<ItemTemplate>
<img width="1020" height="176" src="<%# Eval("FileAttachment","/getattachment/{0}/img.aspx?") %>" alt=""/>
</ItemTemplate>
</cms:CMSRepeater>

and the Image can show when I see in CMSDesk, but in Live Site, the image doesn't display.

How to fix this?

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 5/17/2012 4:09:21 AM
   
RE:Help: Using Repeater to show Image
Hi,

Have you tried to insert to the <ItemTemplate> following code?

<%# GetImage("FileAttachment",1020,176) %>

//parameters of method are GetImage(object attachmentGuidColumn, int width, int height)

Best regards,
Ivana Tomanickova