Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > How can I show a picture from a custom table? View modes: 
User avatar
Member
Member
evdn-centiq - 9/29/2009 2:51:38 AM
   
How can I show a picture from a custom table?
Hello there.

I am using the free edition of kentico version 4.1 and I have a question.
How can I show a picture and a file on my website from a custom table.
I have created a custom table and I found out how I can add pictures and files to the custom table.
But when I show the input of the custom table on my site the picture and the file is not shown.
The picture shows a picture icon with a red cross, meaning it can't find the picture, and the link of the file is not working.
Can someone help me with this?

Thanks in advance.

Edwin

User avatar
Member
Member
kentico_pavelk - 9/29/2009 3:53:42 AM
   
RE:How can I show a picture from a custom table?
Hi Edwin,

Could you please tell us what web part and what trasformation do you use for displaying the files and pictures?


Best Regards,
Pavel Knotek

User avatar
Member
Member
evdn-centiq - 9/29/2009 9:40:58 AM
   
RE:How can I show a picture from a custom table?
Hi Pavel,

I use webpart "custom table repeater" and the default transformation.
But I have modified the default transformation, here do you have the codes:

<table border="1" cellpadding="4">
<tr>
<td><b>First name:</b></td>
<td width="180"><%# Eval("FirstName") %></td>
</tr>
<tr>
<td><b>Last name:</b></td>
<td><%# Eval("LastName") %></td>
</tr>
<tr>
<td><b>Date of birth:</b></td>
<td><%# Eval("DateOfBirth") %></td>
</tr>
<tr>
<td><b>Picture:</b></td>
<td><%# GetImage("ImageHouse") %></td>
</tr>
<tr>
<td><b>File:</b></td>
<td><a href="<%# GetDocumentUrl("RecordLink") %>">klik</a>
</td>
</tr>
</table>
<br/>

Thanks in advance again!

Edwin

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 9/29/2009 10:36:14 AM
   
RE:How can I show a picture from a custom table?
Hello,

Could you please take a look at the following KB article? I think, it will help you.

http://devnet.kentico.com/Knowledge-Base/portalengine/Displaying-custom-data-from-a-database.aspx

Best Regards,
Boris Pocatko

User avatar
Member
Member
evdn-centiq - 10/9/2009 4:47:21 AM
   
RE:How can I show a picture from a custom table?
Hi Boris,

I have read the article but it helped me not so much.
I think the problem doesn't has to do something with the custom transformation in the QueryRepeater, but with the way I have add the pictures into the custom table.
I found out that in some system tables you also can select "file" under Attribute type.
In the custom tables can't you choose "file" under Attribute type.
Could this maybe be the problem?
What is the right way to add a picture or a file to a custom database?

Hope to hear from you again.

Edwin

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 10/13/2009 9:23:46 AM
   
RE:How can I show a picture from a custom table?
Hello,

It always depends on where you have the files saved. If you have for example used a bizform to upload the image, you need to use the approach described in the following Knowledge Base article to display an image http://devnet.kentico.com/Knowledge-Base/Web-parts---Controls/Displaying-images-uploaded-using-BizForm-in-a-tran.aspx.

Best regards,
Boris Pocatko