16
Apr
08

image field adds ?db=master to src attribute

Hey guys,

I experienced a strange and misunderstanding behaviour by the sitecore client. My co-workers reported that sometimes it adds ?db=master to the src attribute of an image field. It looks like this:

<img showineditor=”1″ mediaid=”{A4D0BCFC-9DE7-41BF-BB43-24F9EC8877E3}” mediapath=”/Images/content_1″ src=”~/media/Images/content_1.ashx?db=master“>

After this, you can’t use the src attribute in your xslt if you want to transform the image as well. I modified the xsl in order to use the path field in the image item instead of the src attribute directly.

<variable name=”mediaItem” select=”sc:item(sc:fld(’picture’,.,’mediaid’),.)” />
<img src=”{sc:fld(’path’,$mediaItem)}?w=270&as=false&bc=ffffff” />

This should work and avoid this.

chris



go back // go to overview

0 Responses to “image field adds ?db=master to src attribute”


  1. No Comments

Leave a Reply




September 2010
M T W T F S S
« Mar    
 12345
6789101112
13141516171819
20212223242526
27282930  

Recent Entries