WorryFree Computers   »   [go: up one dir, main page]

Theme sandbox : Long textarea input without a visual editor activated by default

Hi everyone,

I don't know if this behavior is a bug. 

In theme sandbox, Long textarea input without a visual editor activated by default still display the visual editor

                echo elgg_view_field([
                        '#type' => 'longtext',
                        'name' => 'f14b',
                        'id' => 'f14b',
                        'value' => $ipsum,
                        'visual' => false,
                        '#label' => 'Long textarea input (.elgg-input-longtext) without a visual editor activated by default:',
                ]);

Is there another way to display Long textarea input without a visual editor activated by default ?

Regards,

 

  • hmmm this might be a remnant from a time where there was a toggle to show/hide the editor. This is no longer a feature, so this might not be possible anymore.

    What would be the usecase for being able to 'later' toggle an editor?

  • Hi,

    Thanks a lot for your answer.

    toggle to show/hide the editor was I unbelievable feature from my point of view, especially for modern special media platform.

    Nowadays, almost all the web social media offers such functionality because in most cases, users just need a "textarea" when they want to comment on articles or wall. However, they also need to be able to switch (toggle) from  "textarea" to modern editor based on their need. That's why I think the feature was really useful.

    I will need some guidance if possible to re-implement the toggle to show/hide the editor

    Regards,

     

  • I had a look at the code. I was correct. The 'visual' toggle was removed when we switched to CKeditor 5 (when we released Elgg 5).

    If you want ckeditor to not initialize when using a longtext input field you can pass 'editor' => false to the view, but currently there is no way for the user to activate the editor afterwards. If you do not want a editor at all you can use the plaintext input field.

    We do not think the usecase is strong enough to have this kind of feature present in Elgg by default. You are free to develop such a feature yourself of course. For inspiration have a look at this: https://ckeditor.com/docs/ckeditor5/latest/features/restricted-editing.html#demo

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking