DNNDev.com Forums Minimize
DetailImage question
Last Post 30 Jul 2010 01:19 AM by Paul Gibson. 7 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Eric W
New Member
New Member
Posts:16
Avatar

--
17 Feb 2010 05:38 AM  
Hi. I am trying to use the following code:

<xmod:DetailImage alternatetext="View Property" imageurl="/Portals/0/propertyimages/thm_[[Photo01]]">
<parameter name="PropertyID" value='[[PropertyID]]' />
</xmod:DetailImage>

to try to use the thumbnail of each record as the DetailImage link.

It gives me:
Template Compilation Error
The server tag is not well formed.
etc...

I'm guessing that the imageurl cannot contain the brackets [[Photo01]].

Any way of working around this?

Thanks!

Eric
DNNDev Admin
Senior Member
Senior Member
Posts:6314
Avatar

--
17 Feb 2010 03:25 PM  
Hi Eric,

Use the [[Join()]] function token. Because of the way ASP.NET works, it's not possible to simply combine a field token with text in an attribute. The JOIN token makes that possible. You can find the details on how to use it in the help file under Function Tokens.

So, your tag would be re-written as such:

  
<xmod:DetailImage AlternateText="ViewProperty" ImageUrl='[[Join("/Portals/0/propertyimages/thm_{0}", [[Pohoto01]])]]'>
  <Parameter name="PropertyID" Value='[[PropertyID]]' />
</xmod:DetailImage> 


Best,
Kelly
Power Your Website With XMod Pro
Buy XMod Pro Today
Eric W
New Member
New Member
Posts:16
Avatar

--
18 Feb 2010 03:06 AM  
Thanks Kelly! That's exactly what I needed. I can see how the [[Join()]] function could be quite useful in other ways!

Eric
Paul Gibson
New Member
New Member
Posts:11
Avatar

--
18 Jul 2010 11:53 AM  
Hi Kelly
I am having issues with this scenario. I have created a list page. Click and item and get directed to a details page. I have passed the id field to the details page and the details page URL is http://localhost/ttc544/BandPage.aspx?vendorid=15

All data displays well but I can't get the required photo to display?

'LogoFile' does produce the image name as expected but when used in context of the Url in my code example following, nothing gets displayed?

<xmod:DetailImage AlternateText="Individual Photo" ImageUrl='[[Join( "~/Portals/0/vendorImages/{0}", [[LogoFile]])]]'>
<Parameter name="VendorId" Value='[[VendorId]]' />
</xmod:DetailImage>

I have tried all variations on the path eg. ~/Portals/0/vendorImages/{0}, Portals/0/vendorImages/{0}, vendorImages/{0} and I have also removed the parameter (wasn't sure if this parameter is required in my situation?).

Any idea's why the image won't show?
Paul
DNNDev Admin
Senior Member
Senior Member
Posts:6314
Avatar

--
20 Jul 2010 12:25 AM  
Hi Paul,

Have you verified the image is actually in the /Portals/0/vendorimages folder?

Kelly
Power Your Website With XMod Pro
Buy XMod Pro Today
Paul Gibson
New Member
New Member
Posts:11
Avatar

--
20 Jul 2010 10:17 AM  
Yes, Image is definately there.
When I use <span class="SubHead"></span> [[LogoFile]] I get the correct file name for the image displayed eg "filename.jpg".
When I use
<xmod:DetailImage AlternateText="Individual Photo" ImageUrl='[[Join( "~/Portals/0/vendorImages/{0}", [[LogoFile]])]]'>
<Parameter name="VendorId" Value='[[VendorId]]' />
</xmod:DetailImage>
Nothing is displayed?

I used fatgeorge for the initial fileupload within my xmod form.
Paul
Paul Gibson
New Member
New Member
Posts:11
Avatar

--
26 Jul 2010 03:04 AM  
I tried a few other options in the fileupload process and store things in a different folder. The join still doesn't work.
I used a more straight forward method to get the picture;
<xmod:select >
<case comparetype="text" operator="<>" value='[[LogoFile]]' expression="">
<img src="http://www.dnndev.com/Portals/0/DynamicForms_Images/Thumb_[[LogoFile]]" align="left" style="margin-right: 10px;"/>
</case>

This at least found the correct file name but it only displays the red X ?
Paul Gibson
New Member
New Member
Posts:11
Avatar

--
30 Jul 2010 01:19 AM  
I got this working. I didn't require the Join function ?? just a straight image src...
You are not authorized to post a reply.

Active Forums 4.1
spacer
dummy