21490 Posts in 5783 Topics by 2622 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1498 Views |
-
Making Image SRC's Absolute in Body Content

1 October 2009 at 8:27am
Hi Guys,
I'm trying to make my image tags inside $Content appear with absolute links - so instead of
<img src='assets/Uploads/img.jpg'>
I'd like
<img src='http://www.website.com/assets/Uploads.img.jpg'>
I was hoping the AbsoluteLinks() function - $Content.AbsoluteLinks - would do this, but it just adjusts the hrefs. Is there a quick and easy way to handle this?
Thanks!
-
Re: Making Image SRC's Absolute in Body Content

1 October 2009 at 10:10am Last edited: 1 October 2009 10:10am
Ironically, the code for Image->getURL() his this comment:
* @todo Refactor to return absolute URL like {@link File}
So, at some point this might be fixed. For now, you'll have to write it out in your template, using the base tag and relative url:
<img src='{$Top.BaseHref}/{$URL}' />
(Not tested, FYI)
| 1498 Views | ||
|
Page:
1
|
Go to Top |


