admin
-
10/31/2006 2:22:04 PM
Re: Kentico v2.0 Showing images
Hi John,
here's an example of displaying an image in your transformation:
<img alt="<%# Eval("ProductName") %>" src="<%# GetFileUrl("ProductPhoto") %>?maxsidesize=120" />
It's taken from the standard cms.product.preview transformation and it renders code like this:
<img alt="product1" src="/kenticocms/getattachment/8afd3a6c-00fa-48e2-9d6d-286ebb21086f/Acer-AL1511s.aspx?maxsidesize=120" />
This works if you save the logo image as a part of the document. If you're using an image selection field type, you may need to use code like this:
<img src="~/getfile/<%# Eval("NodeGUID") %>/logo.aspx" />
The difference is this: - if you store the file as a part of the document, its attachmentGUID is stored in the database table - if you store the file as a separate document (cms.file), its NodeGUID is stored in the database table
Please let me know if it helps.
|