Wysiwyg adding / in front of link URLs

5 posts by 2 authors in: Forums > CMS Builder
Last Post: January 18, 2010   (RSS)

Hello,

I have a site that requires the use of subdirectories. Within a subdirectory, I have a page that displays something from one of the CMSB records. This record needs to have a link to another page WITHIN that subdirectory.

The trick is, the subdirectory is NOT known at the time of creating the content as it's dynamically created at run-time based on user of the system.

Within the article I'm placing a link to "content-detail.php". When I save it, I get "/content-detail.php" in the window. I don't understand what's causing the link to become absolute even though I am specifying it relative.

I even tried "./content-detail.php" and it changed it to /content-detail.php".

Where is this setting and what do I need to change?

Thanks,
Gary.

Re: [garyhoffmann] Wysiwyg adding / in front of link URLs

By Chris - January 18, 2010

Hi Gary,

By default, the WYSIWYG will convert all URLs to be absolute. You can easily change this behaviour by modifying a bit of JavaScript in a PHP file:

Open up cmsAdmin/lib/wysiwyg.php and search for relative_urls. Change this line:

relative_urls : false,

to this:

relative_urls : true,

As suggested by a comment at the top of the file, you can save the file as wysiwyg_custom.php and it will get loaded instead of wysiwyg.php -- and won't get overwritten when you upgrade.

I hope this helps! Please let me know if you have any questions.
All the best,
Chris

Re: [chris] Wysiwyg adding / in front of link URLs

Thank you!

Re: [chris] Wysiwyg adding / in front of link URLs

I also found reference to a settings called "convert_urls" that you can set to true/false that also seems to help. Don't know if it's necessary, but it also doesn't appear to hurt.

Thanks again.
Gary