Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product

In this Discussion

Please upgrade to 2.3 here. The 2.2 and earlier branches are no longer being updated.

I am wanting to add a particular button.

This discussion is related to the Button Bar addon.
edited December 2011 in Vanilla 2.0 - 2.2

I sort of accomplished this on NBBC but I never got to truly do what I was hoping for (that being part 2).

Maybe you can point me in the right direction, unless it's something you could think up in 5 seconds and decide to post the code.

If I wanted a button that would, for example:


And on the HTML side it does:

<a href="">Rewind</a>

What current button does something similar that I can sort of borrow the concept from? I thought that URL would be similar enough, but while playing around I couldn't quite figure out how to get it working.

I mean similar to the URL in the sense it takes what is between the BBCode and uses it as a url, but I'm not quite sure how to add it to a preexisting string. Like, the preexisting string would be

The second thing I'm trying to get done is a way to group a list of cards, so it'd have to do the same as above but for each new line within the tags. Something like:

[cards]Rewind Animate Dead Duress[/cards]

I don't think there is a current BBCode or Markdown case switch that actually does something to each individual line, is there?


  • edited May 2012

    I keep getting notified that I have an answer and should accept it if correct. I come here and only see my post. Heh.

  • TimTim Operations Vanilla Staff
    edited May 2012

    Button Bar is not currently very easy to extend without modifying the core files. However, if you feel up to it you can do just that.

    Modify views/buttonbar.php

    echo '<span class="ButtonWrap"><span>card</span></span>';

    Modify js/buttonbar.js

    Add a handler for the 'card' event.
    At line 361:

    bbcodeOpts = {
            opener: '[',
            closer: ']'
         switch (Operation) {
            case 'bold':
            case 'card':

    Button Bar relies on Garden's formatters to handle rendering within comments, so you would need to mess with the NBBC plugin to make it handle the rendering side, and that's something beyond the scope of this help.

    Vanilla Forums Senior Developer [GitHub, Twitter,]

  • Hey sorry that question was old and silly. I couldn't modify it. Yeah it's terribly easy to add buttons to this plugin. Thanks for responding though, so I can finally mark this answered and end the jquery notifications.

Sign In or Register to comment.