1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.4 Is it possible to disable wysiwyg editor for mobile

Discussion in 'XenForo Questions and Support' started by Mike Creuzer, Nov 3, 2014.

  1. Mike Creuzer

    Mike Creuzer Well-Known Member

    Just wondering if someone has figured this one out.

    Global. Just for mobile, regardless of preferences, disable redactor.
    Last edited: Nov 3, 2014
  2. Amaury

    Amaury Well-Known Member

  3. Mike Creuzer

    Mike Creuzer Well-Known Member

    Global. Just for mobile, regardless of preferences.
  4. cclaerhout

    cclaerhout Well-Known Member

    Use the "editor_setup" event and modify the $showWysiwyg parameter with something like that:
    $showWysiwyg false;
    Note: the RTE editor will also be disabled on tablets.
    KiF, SneakyDave and Mike Creuzer like this.
  5. Mike Creuzer

    Mike Creuzer Well-Known Member

    Thank you @cclaerhout

    And, fyi, I dont endorse correcting people over stupid things when they are being helpful.
    thedude, SneakyDave, FredC and 2 others like this.
  6. Mike Creuzer

    Mike Creuzer Well-Known Member

    @cclaerhout do you have a way to do it in JS? That might be easier for me.
  7. SneakyDave

    SneakyDave Well-Known Member

    I thought that was JS at first. But sounds like an easy add-on if it isn't?
  8. cclaerhout

    cclaerhout Well-Known Member

    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 likes this.
  9. ge66

    ge66 Active Member

    @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.
  10. Mike Creuzer

    Mike Creuzer Well-Known Member

    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.
  11. RichardKYA

    RichardKYA Well-Known Member


    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
  12. cclaerhout

    cclaerhout Well-Known Member

    "editor_setup" is a listener. You don't have to edit any files. Learn first how to use listeners in XenForo.
  13. RichardKYA

    RichardKYA Well-Known Member

    Ah, OK, thank you :)

Share This Page