Image Paths

Permalink
I am trying to make it so that ALL images throughout my site are absolute paths.

Here is how the images are represented:
<img src="/files/7612/9175/1298/colors.jpg" width="216" height="301" />

Here is how I need them to be represented:
<img src="http://www.MYWEBSITE.com/files/7612/9175/1298/colors.jpg" width="216" height="301" />

Please help! I'm not a programmer but I know a little bit and I just can't figure this out!

Thanks!

 
jbx replied on at Permalink Reply
jbx
Hey,

Curious as to why you would want to do this, but I can help anyways...

There are 2 main places where you add images, the image block and also through the content block.

To update the image block, copy the block from the concrete directory into your root blocks directory. Open up controller.php and around line 58, change
$relPath = $f->getRelativePath();
to
$relPath = BASE_URL . $f->getRelativePath();


I think the content block will already do what you need, but I haven't tested. When you add an image through the content block, TinyMCE decides how to format the URL's. Checking the config, it looks correct.

Let me know if that works for you or if you need more help...

Jon
eblasthelper replied on at Permalink Reply
Thanks so much for the prompt reply!

That worked beautifully for the image block. I'm still not able to figure it out for the content block. Any ideas?
jbx replied on at Permalink Reply
jbx
Ok, also copy the content block to your root blocks folder and open the editor_config.php. Around line 18, you should find the following code:
convert_urls: false,

Replace that with:
convert_urls: true,
remove_script_host: false,


You may need to remove and re-add any previously added images...

Jon
jbx replied on at Permalink Reply
jbx
Why are you doing this??
eblasthelper replied on at Permalink Reply
That worked perfectly! Thank you so much!

My company is designing HTML emails for our clients. The designers on staff have a hard time developing in Dreamweaver so I thought I'd put together some templates in Concrete5. Having the URLs in place make it easier to copy the source code for our purposes.