Welcome Guest, Not a member yet? Register   Sign In
Store img tags in database and retrieve it
#5

I know these possible approaches:

1. If you know how, you may hack CKEditor to paste relative URI's. Long time ago I did such thing on the old FCKEditor, for CKEditor I have not researched how this could be done.

1.1. Then you can add in the head of your master HTML template the tag
Code:
<base href="<?php echo base_url() ?>" />
A complication with links like
Code:
<a href="#top">Top</a>
would need to be dealt, the current URI (with the query string, if any) should prepend them.

1.2. Or, without touching the HTML template, you can scan the HTML fragments from database for relative URI's of images and to prepend them with the base URL before outputting.

(1.) looks like a difficult way. I think, it worths if you create your own CMS that you are going to use multiple times for your projects.

2. The lazy way: You can leave CKEditor to paste absolute URI's, as it does this by default. Before moving your site on the production server, you can open the database dump with a text editor (choose one that is able to edit large files), and using search/replace you can adjust the absolute URI's as the should be in the new place.
Reply


Messages In This Thread
RE: Store img tags in database and retrieve it - by ivantcholakov - 05-14-2016, 04:39 PM



Theme © iAndrew 2016 - Forum software by © MyBB