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.

Archive /

Our old forums are still available as a read-only archive.

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

how I can use $id in img tag


Go to End


3 Posts   1677 Views

Avatar
WebSpilka

Community Member, 89 Posts

13 August 2008 at 9:51pm

Edited: 13/08/2008 9:52pm

When I write

<img src="./img/lmh/$ID.jpg" align="left" alt="" border="0">

I have result
<img src="./img/lmh/" align="left" alt="" border="0">

when I write

<img src="./img/lmh/ $ID .jpg" align="left" alt="" border="0">

I have next result
<img src="./img/lmh/%2013%20.jpg" alt="" _base_href="http://raritet.org.ua/" align="left" border="0">

I need next result

<img src="./img/lmh/13.jpg" alt=""  align="left" border="0">

Avatar
Phalkunz

Community Member, 69 Posts

13 August 2008 at 10:12pm

It was posted somewhere by Will. Anyways, I post it up again :) It needs to be {$ID}.jpg
When you write $ID.jpg, SS looks for ID.jpg field the current page type.

Avatar
WebSpilka

Community Member, 89 Posts

14 August 2008 at 12:28am

thanks you