Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » how I can use $id in img tag

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

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

Page: 1
Go to End
Author Topic: 1248 Views
  • fiord
    Avatar
    Community Member
    79 Posts

    how I can use $id in img tag Link to this post

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

  • Phalkunz
    Avatar
    69 Posts

    Re: how I can use $id in img tag Link to this post

    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.

  • fiord
    Avatar
    Community Member
    79 Posts

    Re: how I can use $id in img tag Link to this post

    thanks you

    1248 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.