Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
darkdreamingdan Posted September 13, 2016 Posted September 13, 2016 The code editor always seems to default to HTML. This is annoying for programming boards who don't use any HTML. I've found that the theme is responsible for this, and the html template at core/global/editor/code presents the main editor. If you hit variables, you'll see this: However, changing the string from 'html' to anything else doesn't seem to work. It always defaults to HTML no matter what. Would appreciate some guidance on how to change the default language.
Nathan Explosion Posted September 13, 2016 Posted September 13, 2016 As the codemirror reference to 'html' is actually 'htmlmixed' then I don't think that template does control it - I'm away from my main machine until the morning, so won't be able to confirm until I've tested it out but I don't think the change you are making will have any effect.
darkdreamingdan Posted September 18, 2016 Author Posted September 18, 2016 For anyone interested in solving this problem, the following fix worked for me. It's hacky but does the job. Enter ACP->Customisation->Themes. For your theme, edit the HTML and CSS. Open the core/global/editor/code file. On line 10, you should see the following line: <select id='elCodeMode{$randomString}' data-role="codeModeSelect" data-codeLanguage="{$language}"> Change it to the following instead: <select id='elCodeMode{$randomString}' data-role="codeModeSelect" data-codeLanguage="{{if $val == ''}}YOURLANG{{else}}$language{{endif}}"> Replace "YOURLANG" with the language you want to be default. For example 'php' or 'xml'. It should be lowercase. Good luck.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.