XF 1.4 Is it possible to disable wysiwyg editor for mobile

Dad.

Well-known member
Just wondering if someone has figured this one out.

Global. Just for mobile, regardless of preferences, disable redactor.
 
Last edited:
@cclaerhout do you have a way to do it in JS? That might be easier for me.
Only JS no. Once the $showWysiwyg variable is enabled, the editor template will be formatted and designed for html code: the text content of the editor will be in html format, the wrapper name will not be the same, etc. For example, if you want to enable first the Bb Code editor, then triggers the RTE, it's not a simple and quick modification to do (ref): it will require php and js code. The solution of using the XenForo editor_setup listener should be the easiest one for what you want to do.
 
@Mike Creuzer did this get included in a style or addon.
Or do anyone know of an addon that makes it so that mobiles automatically gets a simpler editor.
Not that I am aware of. It is potentially something we could build custom though, but Id have to look into how to do it. I was just asking if there was a quick way to do it.
 
Use the "editor_setup" event and modify the $showWysiwyg parameter with something like that:
PHP:
if(XenForo_Visitor::isBrowsingWith('mobile'))
{
  $showWysiwyg = false;
}
Note: the RTE editor will also be disabled on tablets.

Hello,

I am looking to do something like this, but I'm pretty new to code and I'm not that great with php at the moment, but I think I've narrowed it down to the Editor.php file and found 'editor_setup' on line 96, but I'm not that sure if this right and if it is, where exactly to put this bit of code, so a point in the right direction would be greatly appreciated

Many thanks
 
Hello,

I am looking to do something like this, but I'm pretty new to code and I'm not that great with php at the moment, but I think I've narrowed it down to the Editor.php file and found 'editor_setup' on line 96, but I'm not that sure if this right and if it is, where exactly to put this bit of code, so a point in the right direction would be greatly appreciated

Many thanks
"editor_setup" is a listener. You don't have to edit any files. Learn first how to use listeners in XenForo.
 
Top Bottom