The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

How to add a new button to the editor?

View previous topic View next topic Go down

Solved How to add a new button to the editor?

Post by darki on September 6th 2015, 1:51 pm

Hi,

I want to add a new button to the editor, but only what I found were this:
http://help.forumotion.com/t140216-add-font-awesome-button-to-the-editor
http://help.forumotion.com/t104467-adding-a-custom-button-to-the-forumotion-text-editor
http://fmdesign.forumotion.com/t212-change-the-button-icons-of-the-editor

And that is not what I want or it doesn't work.

Does anyone know how to add a button to the editor? WYSIWYG is activated.

Thanks in advance!


Last edited by darki on September 6th 2015, 3:23 pm; edited 1 time in total

darki
Forumember

Posts : 254
Reputation : 10
Language : German, english

http://schiggysboard.com

Back to top Go down

Solved Re: How to add a new button to the editor?

Post by brandon_g on September 6th 2015, 2:25 pm

Hello,

I suppose it depends on what sort of button you wish to add. Most should be able to be added with some Javascript and CSS.


What kind of button would like to add exactly?

-Brandon


Remember to mark your topic when a solution is found.

brandon_g
Support Moderator
Support Moderator

Male Posts : 5357
Reputation : 489
Language : English
Location : USA

http://broadcastingduo.forumotion.com/

Back to top Go down

Solved Re: How to add a new button to the editor?

Post by Ange Tuteur on September 6th 2015, 2:29 pm

There's also this : http://help.forumotion.com/t141539-is-that-possible-simple-menu-with-quick-replys#965626

But like brandon mentioned, it really depends on what type of button you're looking for. This is the documentation for creating custom SCEditor commands btw : http://www.sceditor.com/documentation/custom-commands/

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: How to add a new button to the editor?

Post by darki on September 6th 2015, 2:31 pm

@Ange Tuteur I think that is not what I am looking for. :/

This is the bbcode for the button:
Code:
[table class=youtube][tr][td]
///////
[/td][/tr][/table]

I have a script for that, so that this bbcode creates a youtube playlist which works great. Now I only want a button for that. Smile

darki
Forumember

Posts : 254
Reputation : 10
Language : German, english

http://schiggysboard.com

Back to top Go down

Solved Re: How to add a new button to the editor?

Post by Ange Tuteur on September 6th 2015, 2:42 pm

So you want when you click that button, those tags are inserted ?

The command would most likely look something like this :
Code:
$(function() {
  if (!$.sceditor) return;
 
  $.sceditor.command.set('yt-playlist', {
    exec : function() {
      this.insertText('[table class="youtube"][tr][td]', '[/td][/tr][/table]');
    },
 
    txtExec : function() {
      this.insertText('[table class="youtube"][tr][td]', '[/td][/tr][/table]');
    },
 
    tooltip : 'Insert youtube playlist'
  });
 
  toolbar += '|yt-playlist'
});

With the information you've given me at least. Smile

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: How to add a new button to the editor?

Post by darki on September 6th 2015, 2:54 pm

I can not say often enough: Thank you, you are the best! Smile

If I want to change the button image whith another image, would that be possible? And how?

darki
Forumember

Posts : 254
Reputation : 10
Language : German, english

http://schiggysboard.com

Back to top Go down

Solved Re: How to add a new button to the editor?

Post by Ange Tuteur on September 6th 2015, 3:18 pm

You should be able to add your own image with this CSS rule. Wink
Code:
.sceditor-button-yt-playlist div {
  background-image:url('IMAGE_URL') !important;
}

Just replace IMAGE_URL by the URL of your image. Smile

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: How to add a new button to the editor?

Post by darki on September 6th 2015, 3:24 pm

Great, thank you, Ange. Another "problem" solved. Smile

darki
Forumember

Posts : 254
Reputation : 10
Language : German, english

http://schiggysboard.com

Back to top Go down

Solved Re: How to add a new button to the editor?

Post by Ange Tuteur on September 6th 2015, 3:54 pm

You're welcome. ^^

Topic archived

Have a good day. Smile

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum