Developer forum

Forum » Templates » File Item property in image-tag

File Item property in image-tag

Daniel Williams
Reply

Hello,

I have this wierd bug, that if i output @GetString("Item.Image") i get the path to the file,
But if i output the same code inside a <img>-tag, i get a different path, and a wierd tag close.
- I also tried with an item, called Item.PageImage

What am I doing wrong?

Please see the attachment.

Screen_Shot_2015-02-09_at_11.46.59.png

Replies

 
Mikkel Ricky
Reply

You're using double quotes inside double quotes and that confuses Html Agility Pack which is used when preprocessing Dynamicweb layout templates.

Use

<img src='@GetValue("…")'/>

in stead.

Best regards,
Mikkel

 
Nicolai Høeg Pedersen
Reply

Or put the template tag value into a variable first.

This is described in the Razor documentation

 
Daniel Williams
Reply

This is solved in this forum post: http://developer.dynamicweb.com/forum/templates/re-reference-page-item-file-field-to-image-src.aspx

 

You must be logged in to post in the forum