1

Topic: Limit the options in the Insert/Edit Links pop-up

Is there a way to reduce the option in the InsertEdit Link pop-up?

I wouldn't give to many options to the users I would like to let them specified just "Link URL", "Target" (with just two options) and "Title".
Is this possible?
Can you please point to me the js files where I can intervene?

Thank you a lot

2

Re: Limit the options in the Insert/Edit Links pop-up

I would assume you are using the advanced link dialog, as the basic one has just the list you mentioned.

Check your config to see if you've included the plugin advlink and if so, try the dialog without it.

  Cheers,
  Brett

Brett Henderson
http://tinymce.ephox.com

3

Re: Limit the options in the Insert/Edit Links pop-up

Thank you so much
You are right I've included the plugin advlink.
Do you know if it's possible to set by default the TARGET to "Open Link in a New Window" and possibly delete the option "-- Not Set --" ?

Thank you very much

4

Re: Limit the options in the Insert/Edit Links pop-up

You will need to edit the link.htm file in the tinymce/jscripts/tiny_mce/themes/advanced directory. Remember though that if you upgrade your instance of TinyMCE your edits will be overwritten, so take a backup.

  Cheers,
  Brett

Brett Henderson
http://tinymce.ephox.com

5

Re: Limit the options in the Insert/Edit Links pop-up

I found the file but I don't know where I can modified the code (I thought I could find a tag select with the 3 values but what I have is

<select id="target_list" name="target_list"></select>

Can you please explain me better the concept about upgrading TinyMce instance?

Thank you so much

6

Re: Limit the options in the Insert/Edit Links pop-up

My apologies, I hadn't dug into the file and so didn't realise that the list is dynamically built. You need to look in the link.js file in the tinymce/jscripts/tiny_mce/themes/advanced/js directory. In there you will find a method fillTargetList that populates the list.

One thing you need to consider is that if you remove the "not_set" option, then when you open a link where the target wasn't set, you will not have an option to display. So, in the init method you will need to handle that.

With respect to upgrade, what I meant was that if you decided to modify these files, then when you next upgrade TinyMCE, and replace your current installation, you will overwrite your changes. So during an upgrade you will need to merge your changes to these core files with the new files in the upgraded TinyMCE.

  Cheers,
  Brett

Brett Henderson
http://tinymce.ephox.com

7

Re: Limit the options in the Insert/Edit Links pop-up

Thank you very much Brett

I found the code and commented the two strings
lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), '');
lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_same'), '_self');

So I just have the option "Open link in a new window" available

I tried and it seems work properly...
I set a link then submitted the form and finally update the same link through the "Insert/Edit Link" pop-up.

Do I have to test something else in order to be sure that everything works perfectly?

Thank you