Posted: Jan 17, 2010 - 12:16 pm | |
Giving your AdaptCMS installation "Relative URL's" will help you out greatly in the long run. Why? Because having a URL like
| Quote: | | http://yoursite.com/upload/coolpic.jpg |
This is called a "Absolute URL" and could pose a problem if you change domains folders etc. In comparison having something like
| Quote: | | /upload/coolpic.jpg |
Would reduce such errors to a certain extent. If you have over 2000 articles in your database it might not be very feasible to manually change the URL's for all the images you've used after making a change to your file system.
Fortunately TinyMCE has a feature built in to handle relative URL's!
- Open functions.php in your editor of choice.
- Find the WYSIWYG function (doing a search for WYSIWYG will do the trick).
In the WYSIWYG function find
As of writing it should be set to false change it to true.
| Quote: | | relative_urls : true |
Moving up a bit directly under
| Quote: | | elements : 'abshosturls' |
Add
| Quote: | | document_base_url : '".$siteurl."' |
The siteurl variable was defined above immediately following the function it pulls the information from what you have listed in your Admin Panel for your URL.
- Save the file.
- Upload it to your server.
- Test it out on anything that uses TinyMCE in AdaptCMS.
Keep in mind however that both Relative and Absolute URL's have their benefits in the end it's up to preference. This will also work in anything running TinyMCE including AdaptBB OneCMS etc.
And you're done! Questions comments etc? Post away!
Further Reading
http://www.webdevelopersnotes.com/design/relative_and_absolute_urls.php3
http://brainstormsandraves.com/archives/2003/09/07/relative_vs_absolute_urls/
OneCMS: http://onecms.net
|