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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

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   1600 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