Notifications
Clear all

wpForo 1.x.x [Solved] How to add the "image" button to mce toolbar editor?

12 Posts
6 Users
6 Reactions
4,352 Views
Posts: 10
Topic starter
(@moisb)
Active Member
Joined: 6 years ago

Hi, I would like to configure the Topics and Reply editors, removing some buttons and adding others, such as the simple image insert button, like this:

 

I tried edit the functions "function topic_form($forumid)" and  "function reply_form($args)" on plugin file class-template.php and this works, but I know this is not recommended because it will be overwritten in the next update.

So I would like to request that it be allowed to enable/disable buttons of the toolbar editor in the control panel of the WPForo or receive the ideal code snippet to override these functions through the functions.php of my theme. So that it does not conflict with future features that developers are planning for WPForo  😉 

@robert potresti aiutarmi con questo? Per favore? 

P.S: css hacks (display:none) and "Tiny MCE Advanced" plugin they are not good alternatives

Topic Tags
11 Replies
Sofy
Posts: 4585
 Sofy
Admin
(@sofy)
Support Team
Joined: 7 years ago

Hi @moisb,

 I know this is not recommended because it will be overwritten in the next update.

yes, it'll be overwritten in the next update. You should keep this file and update it after each update. 

Please note: wpForo has file attachment option on the editor, also it allows you to embed an image using URL, but we don't recommend to copy it. More info:

https://wpforo.com/docs/root/topics-posts/atatch-file-to-post/

In any case, you can click on {;} toolbar button and check the image source, maybe something is wrong with your copied data.

Posts: 10
Topic starter
(@moisb)
Active Member
Joined: 6 years ago

Hi @sofy. This is a tip to facilitate users to insert/show images directly into the message body. Most users do not know how to add html tags <img> to this and it's neither practical 🙁

I believe that this simple change (activate the image button) makes WPForo even better 🙂

Posts: 533
(@central4allgmail-com)
Prominent Member
Joined: 6 years ago

The best thing is to be able to choose the buttons in the bar.

Why someone to have  buttons that they are not usefull to him and they are only to somebosy else?

 

Florian
Posts: 92
(@florian)
Estimable Member
Joined: 5 years ago

This is how I changed the buttons in the editor in functions.php. However, I didn't write this code myself so I am not sure how good it is:

add_filter( 'wp_editor_settings', function( $settings ){
if ( empty( $settings['tinymce'] ) || ! is_array( $settings['tinymce'] ) )
$settings['tinymce'] = [];

$settings['tinymce']['paste_as_text'] = 'true';
$settings['tinymce']['toolbar1'] = 'bold,italic,underline,codesample,undo,redo';

return $settings;
} );

"toolbar1" defines the buttons that you want to have in the editor.
I also added another TinyMCE plugin this way (codesample).

Page 1 / 2