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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

Image path only (not <img> tag)


Go to End


3 Posts   2351 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
bummzack

Community Member, 904 Posts

7 May 2009 at 5:45am

Use:

$image.Link