Download
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

Allow the scripts and configurations in tinymce editor

  • #675
    Avatar photo[anonymous]

    Hi,

    I follow these instructions without results https://getpublii.com/dev/how-to-add-custom-config-or-js-for-post-editor/

    1. Add “extensions” section in config.json at the end of file
      `{`
      `  “name”: “QF”,`
      `  …`
      `  “extensions”: {`
      `    “postEditorConfigOverride”: true,`
      `    “postEditorCustomScript”: true`
      `  }`
      `}`
    2. Create tinymce.override.json file in folder_override template
    3. Add options in tinymce.override.json file
      `{`
      `  “toolbar2”: “”,`
      `  “valid_elements”: “*[*]”`
      `}`

    Toolbar 2 is not removed.
    All scripts are converted in
    ``
    or
    ``

    Thank you

    #728
    Avatar photo[anonymous]

    Hi,

    To disable toolbar you have to set it to false instead of empty string.

    Regarding script conversion – it is an internal TinyMCE mechanism which cannot be overrided even with valid_elements option.

    #731
    Avatar photo[anonymous]

    Hi Tomasz ,

    thank you very much.

    Alternatively I can use an external js script:

    ``

    or, custom HTML element.

    #996
    Avatar photo[anonymous]

    Hi

    I tried the same process, and the toolbar2 in post editor is not removed.
    I use Publii on linux, do I have to refresh something ?

    in Publii/testsite/input/themes/simple/config.json
    juste before “customElements”, I added :

    `”extensions”: {`
    `”postEditorConfigOverride”: true,`
    `”postEditorCustomScript”: true`
    `},`

    In same folder
    I created tinymce.override.json, I added only :

    `{`
    `”toolbar2″: “false”,`
    `”extended_valid_elements”: “*[*]”`
    `}`

    #1000
    Avatar photo[anonymous]

    Hi @anselmyst

    try

    `{`
    `”toolbar2″: false
    }`

    It works!

    #1001
    Avatar photo[anonymous]

    Hi

    It doesn’t work 🙁

    Do you agree that it’s supposed to remove the black toolbar ?

    Capture-d’écran-de-2019-12-11-19-29-39

    #3579
    Avatar photo[anonymous]

    Like others, I am having trouble overriding TinyMCE. I’m using an override of the blank theme. In site/input/themes/blank-override I have the following config.json:

    {
        "name": "Blank",
        "version": "1.0.0.0",
        "...": "edited for brevity",
        "extensions": {
            "postEditorConfigOverride": true,
            "postEditorCustomScript": true
        }
    }

    and the following tinymce.override.json:

    {
        "toolbar1": "styleselect formatselect searchreplace removeformat undo redo",
        "toolbar2": "image bullist numlist bold italic link unlink media table"
    }

    When I load Publii, the standard toolbars show up: publii-screenshot