WYSIWYG Link Base

5 posts by 2 authors in: Forums > CMS Builder
Last Post: April 3, 2013   (RSS)

By Steve99 - March 28, 2013

Hello,

I'm aware that in /cmsAdmin/lib/wysiwyg.php you can set relative URLs to true or false (saving as wysiwyg_custom.php).

We are setting up a mobile site version in a subfolder called /mobile/ with all the same pages and file names as the main site. If we change the setting for relative URLs to true, text links will behave as desired but CMS stored image links break since the cmsAdmin is in the root folder.

Is there a way to treat text links and image paths differently in the WYSIWYG so the text links can be relative and CMS stored image paths would not be relative?

Thanks in advance.

Steve

By gregThomas - April 2, 2013

Hi Steve,

Sorry for the delay in reply.

If you add the following lines below relative_urls in your wysiwyg.php file:

    relative_urls : true,
    convert_urls : false,
    document_base_url: "/",

Having convert_urls set to false will stop the WYSIWYG editor changing the links to be relative or absolute automatically. Any image uploaded will still have the absolute path used, but if you create a relative link it will not be converted to absolute by the editor.

Let me know if you have any questions.

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By Steve99 - April 2, 2013

Hi Greg,

Awesome, thank you! I'll give that a go.

Saves me from creating mirrored upload folders and doing a mount bind : )

Thanks again!

Steve

By Steve99 - April 3, 2013

Hi Greg,

After poking around and doing some reading, it looks I'd be able to utilize any of the tinyMCE advanced configuration settings by setting them in the tinyMCE.init section of wysiwyg.php.

Just to confirm, if I save that file appending "_custom" it will be retained and used when a CMS upgrade is performed correct? Then if there is new functionality added to the wysiwyg file, I can recreate the wysiwyg_custom file and push any added config settings over manually by copy/paste or winmerge.

Thanks, Greg.

Steve