Skip to main content
Topic: How to add BBCode button? (Read 2770 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

How to add BBCode button?

I hate javascript...

I read files and it led me to jquery.sceditor.elkarte.js. Then I added there my code just after end of pre tag, but my button is still not visible.

Just can't figure out how to add this button :|

Re: How to add BBCode button?

Reply #1

To add new BBC's there are a few steps.

1) add code to parse_bbc so the page parser knows what to do with it
2) add item icon to the toolbar
3) add item code to the JS so it can be
  • added to the textarea when the toolbar icon is clicked in both standard and wysiwyg modes
  • rendered via the JS so you can see what it looks (mostly) like what parse_bbc would do with the code, so it toggles the bbc<->html in the JS depending on what viewing mode you are in the editor.

The only thing needed is item 1) ... 2 and 3 are optional but complete a fully integrated button.    I'll try to come up with a quick example to show how this done (unless @emanuele  has one already)
Last Edit: July 19, 2014, 09:14:06 am by Spuds

Re: How to add BBCode button?

Reply #2

I added bbcode with hook (integrate_bbc_codes), but only button is making me problems :/

Re: How to add BBCode button?

Reply #3

Nope, no examples handy...
Bugs creator.
Features destroyer.
Template killer.


Re: How to add BBCode button?

Reply #5

Thanks :) Now I know where was my mistake ::)

Re: How to add BBCode button?

Reply #6

Thank you for this.  I want to add a couple of custom buttons and I think this will help.