Jump to:

7939 Posts in 1472 Topics by 944 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Need Image link without the 'img src' tag

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1
Go to End
Author Topic: 593 Views
  • Snowlord
    Avatar
    Community Member
    6 Posts

    Need Image link without the 'img src' tag Link to this post

    I'm trying to add the ability to insert an image into the background of a div. I have my CSS:

    -----------
    <style type="text/css">
       .mainBackground {
       background: #000 url('$BackgroundImage') no-repeat left top;
       }
       </style>
    -----------

    And added the proper tab into the php page:

    -----------
    $fields->addFieldToTab("Root.Content.Images", new ImageUploadField('BackgroundImage', 'Background Image'));
    -----------

    Everything functions as expected EXCEPT, it adds in the '<img src' tag (as it should). Is there a way to have the same functionality, only JUST insert the actual image path WITHOUT the 'img src' tag or the 'alt' tag?

    Thanks!

  • UncleCheese
    Avatar
    4085 Posts

    Re: Need Image link without the 'img src' tag Link to this post

    $BackgroundImage.URL

    --------------------
    SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com

    593 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.