String imageURL = MgnlContext.getContextPath() +"/data" +
providerNode.getNodeData("logo").getHandle();
should do the trick. Or even better:
String imageURL =
MagnoliaTemplatingUtilities.getInstance().createLink(providerNode.getNodeData("logo"));
HTH,
Jan
On Thu, 2009-10-22 at 19:49 -0700, Rita_ wrote:
>
> Hi,
>
> How do I display an image that is stored under the data module for my
> defined data type?
>
> For example, I have a data type called "product" which has a property called
> "logo" (which is of data type binary). The content node created under the
> "product" data type was "test".
>
> I tried the following in my jsp:
>
> Content providerNode = null;
>
> providerNode =
> MgnlContext.getHierarchyManager("data").getContent("product/test");
>
> String imageURL = providerNode.getNodeData("logo").getHandle() + "/" +
> providerNode.getNodeData("logo").getAttribute("fileName") + "." +
> providerNode.getNodeData("logo").getAttribute("extension");
>
> However this imageURL doesn't retrieve the image in my jsp when I set it as
> the src in the image tag?
>
>
> I would appreciate it if anyone could help me on this. Thanks.
>
> Cheers,
> Rita.
>
>
>
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------