Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Image path only (not <img> tag)


Reply


3 Posts   1574 Views

Avatar
DeklinKelly

Community Member, 197 Posts

7 May 2009 at 1:14am

This:

<img src="$image" alt="$alt" />


returns this:

<img src="<img src="/ss/ss/assets/" alt="" />" alt="Image Alt Text" />

I want $image to return ONLY the image PATH and NOT the <img> tag.

Avatar
TerryMiddleton

Community Member, 108 Posts

7 May 2009 at 1:21am

hknight,

I think what you want do to is reference the field inside the $image: $image.url

What is the name of the field that the url gets stored in? Use that field name.

Terry

Avatar
banal

Community Member, 901 Posts

7 May 2009 at 5:45am

Use:

$image.Link