7913 Posts in 1355 Topics by 930 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, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 385 Views |
-
Need Image link without the 'img src' tag

8 December 2011 at 12:39pm
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!
-
Re: Need Image link without the 'img src' tag

10 December 2011 at 4:12am
$BackgroundImage.URL
--------------------
SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com
| 385 Views | ||
|
Page:
1
|
Go to Top |

