How to dispaly a custom filed from document type

Mateusz Żebrowski asked on June 5, 2014 05:29

Here is the problem: I've got document type for product which I need to display. In this document type I add new fields, lets call it 'FineText' and 'FineImage'. Now I'm try to write transformation:

<%# GetImage("FineImage")%>
<%# EvalText("FineText", true)%>

but it's not works.

Recent Answers


Filip Ligač answered on June 9, 2014 03:25

Hello Mateusz,

Generally, transformation methods which can be used for displaying data mainly depend on the form control of a certain field.

So, for standard TextBox fields, you can usually take advantage of a simple <%# Eval("FineText")%> but images are often more complex because there are several form controls which can store them and almost each one of them does it in a different way. For example, here are methods which work with particular controls:

Image selection - <img src="<%# GetDocumentUrl("FineImage", "") %>" />
Media selector - <img src="<%# GetAbsoluteUrl(Eval("FineImage").ToString()) %>" width="900px" />
File field - <%# GetImage("FileField", 300) %></td>

As you can see, the logic might be quite tricky so it would be best if you could specify which form control you use so we could narrow the list of appropriate methods down.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.