Topic on Extension talk:TinyMCE

Change default Image & Link parameters

4
Summary by DuncanCrane

User updated work-around so it now works :-)

Calebfergie (talkcontribs)

Hi there,

I was wondering if it's possible to change the default parameters from images and links?

At least for the TinyMCE editor in my wiki, when I click the 🖻 upload/edit file icon, the parameters in the image tab default to:

Vertical alignment: Middle

Horizontal alignment: Right

Format: Thumb


Similarly for 🔗linking, the default parameter is type: external


I would prefer different defaults for these - could anyone recommend a way to change them? Is it something in TinyMCE, or maybe a $wgDefault-style command I could use in LocalSettings.php?


I'm new to wiki/php so let me know if you need some other info. Thanks!

DuncanCrane (talkcontribs)

Hi Calebfergie

Sorry for the delay in replying and thank you for using the TinyMCE Extension and raising this query.

Unfortunately these defaults are set in the code. I think I could add some settings for this into LocalSettings though. Currently I'm working on a new version with quite a few enhancements so my preference would be to add this to the new version if that's OK/

In the meantime, if you you are happy to edit the code, for the upload these settings are in:

'function displayForm(dialogData)' on line 363 of .../extensions/TinyMCE/tinymce/plugins/mw_upload/plugin.js

To change the default of the linking to 'internal' first rather than 'external' you can reverse the entries in:

array 'link_class_list:' on line 66 of .../extensions/TinyMCE/MW_tinymce.js

Hopefully that will be OK for now. Do let me know if you've any other suggestions DuncanCrane (talk) 09:21, 20 June 2019 (UTC)

Activede (talkcontribs)

Apparently that workaround doesn't work anymore. But changing order on

line 145 in .../extensions/TinyMCE/custom_plugins/mediawiki/plugins/mw_wikilink/plugin.js works.

DuncanCrane (talkcontribs)

Thanks Activede, I'll check that out and update. Duncan