• Resolved flizzywp

    (@flizzywp)


    Hello,
    since my users are going to post a lot of code snippets, is it possible to add a simple code formatting button to the minimalistic editor? I noticed that code is formatted automatically when I paste it with Ctrl+V, but it would be nice if that could also be done over a button.
    Also, if that’s possible, I would like to have it available in the minimalistic editor, not the extended one.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Asgaros

    (@asgaros)

    Hello @flizzywp

    I can suggest you the following editor-extension which is working fine in combination with Asgaros Forum:
    https://www.ads-software.com/plugins/enlighter/

    To make it work in the frontend please add the following code to your themes functions.php file:

    function mm_ejs_frontend_editing($allowed) {
    	return true;
    }
    add_filter('enlighter_frontend_editing', 'mm_ejs_frontend_editing');
    Thread Starter flizzywp

    (@flizzywp)

    Thank you. Currently, I am using Crayon Syntax Highlighter. If I could add this as a button it would be perfect!

    But would it also be possible to add the normal simple code button? The one which just adds backticks? I am afraid that users are overwhelmed by Crayon’s options.

    • This reply was modified 6 years, 1 month ago by flizzywp.
    • This reply was modified 6 years, 1 month ago by flizzywp.
    Plugin Author Asgaros

    (@asgaros)

    @flizzywp It depends on the implementation of Crayon Syntax Highlighter. If this plugin supports the front-end editor, then it will also work inside of Asgaros Forum because Asgaros Forum uses the WordPress editor.

    I dont know what you mean with “simple code button” but if its a feature of Crayon Syntax Highlighter, then it should be possible to configure it in the options of the plugin. Otherwise please try to contact the developers in there support-forums. In general: All editor-plugins also work with the editor which is used by Asgaros Forum as long as the developers allows their functionality to be used in the front-end.

    Thread Starter flizzywp

    (@flizzywp)

    Right here in this forum, for example, the editor has the following button:

    View post on imgur.com


    This one just adds 2 backticks, which displays the text as code.

    The same button in Asgaros would be perfect for me because it’s very simple to use. Is there a way to get it into the minimalistic editor?

    Right now, this format doesn't work in Asgaros when I add 2 backticks, but it works if I copy paste the formatted code from here into the forum editor.

    • This reply was modified 6 years, 1 month ago by flizzywp.
    • This reply was modified 6 years, 1 month ago by flizzywp.
    • This reply was modified 6 years, 1 month ago by flizzywp.
    • This reply was modified 6 years, 1 month ago by flizzywp.
    Plugin Author Asgaros

    (@asgaros)

    Is there a way to get it into the minimalistic editor?

    The plugin should have an option for this. Otherwise you have to ask the developer of the plugin on how to display the button when the teeny-mode is enabled inside of the WordPress TinyMCE editor.

    I dont know the “Crayon Syntax Highlighter” and also not its code, so I cant tell you on how to do this.

    If you want to use the text-mode of the editor only, you can try to add this code to your themes functions.php file:

    function change_editor_settings($settings) {
        $settings['teeny'] = false;
        $settings['quicktags'] = true;
        return $settings;
    }
    add_filter('asgarosforum_filter_editor_settings', 'change_editor_settings');
    Thread Starter flizzywp

    (@flizzywp)

    No this just broke the editor.
    But the text-mode isn’t what I want anyways.
    Crayon can be put into the frontend, but it’s way too complicated for a normal user.

    Is “teeny mode” the name for the minimalistic editor? Maybe I can find something myself.

    Plugin Author Asgaros

    (@asgaros)

    Yes, tenny-mode is a setting for the WordPress editor so it only shows one row of buttons.

    Thread Starter flizzywp

    (@flizzywp)

    Ok, I try my best.
    Btw, does your plugin not have any paid version? How is that profitable for you?

    Plugin Author Asgaros

    (@asgaros)

    Let me know if everything is working well! ??

    No, there is no paid version or any paid addons. I develop this plugin in my free time and satisfied users can support the further development via a donation and/or a good review here in the WordPress repository.

    In the end it is not a profitable hobby in regards of money, but it helps me to stay up-to-date in PHP & WordPress development.

    Thread Starter flizzywp

    (@flizzywp)

    Ok, I’m gonna send you a donation for your help

    Plugin Author Asgaros

    (@asgaros)

    Thank you for your support!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Would there be a way to get a “code” formatting button into the editor?’ is closed to new replies.