Jump to:

23483 Posts in 18965 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » DataObject and absolute address for images

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 201 Views
  • Arbee
    Community Member
    17 Posts

    DataObject and absolute address for images Link to this post

    Hi, hoping someone can help me. I'm using 2.4.5 and trying to get htmleditor to insert absolute addresses for images. I used the following code which worked successfully in page.php

    protected function onBeforeWrite() {
    $this->Content = str_replace(' src="assets/', ' src="http://mysite.com/assets/', $this->Content);

    but I cannot make the same work for a dataobject. Is it possible? or is there some other way to do it?


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.