Jump to:

7938 Posts in 1541 Topics by 945 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Links created in SimpleTInyMCEField

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 461 Views
  • aragonne
    Community Member
    26 Posts

    Links created in SimpleTInyMCEField Link to this post

    Hi there,

    When using the link editor (ie, the button with the chain link icon) in a SimpleTinyMCEField with the DataObjectManager, I discovered that SimpleTinyMCEField rewrites all root relative links to be page relative to the location of the SimpleTinyMCE source code. For example, if I enter the url /glossary/abscess and click Save, the link is converted to ../../../../../glossary/abscess.

    I poked around the source code and found that in DataObjectManager's code/simple_tinymce_field/javascript/tiny_mce/tiny_mce_src.js file, there are two settings: convert_urls and relative_urls. Both are set to 1. If I set them both to zero, SimpleTinyMCEField no longer rewrites the link(s), which is what I wanted.

    My question is, is there a better way to update these two settings, for example in _config.php, so I wouldn't have to touch the core Javascript?


  • paradigm
    Community Member
    5 Posts

    Re: Links created in SimpleTInyMCEField Link to this post

    To answer your question, add the following line anywhere in your _config.php;

    SimpleTinyMCEField::set_default_extra_options('convert_urls: 0, relative_urls: 0');

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.