No announcement yet.

How can I make a default {option} when making BB code?

  • Filter
  • Time
  • Show
Clear All
new posts

  • How can I make a default {option} when making BB code?

    What I am trying to do is create a Spoiler Tag on my forums where a user clicks a button and it displays the spoiler for whatever it may be. The HTML for the BB code is the following:

    <div class="spoiler">
    <input type="button" class="button" onClick="showSpoiler(this);" value="Show Spoiler">
    <span class="content" style="display:none">[{param}]</span>
    It basically makes a button with text on it saying "Show Spoiler," and the user clicks on it and it shows the spoiler. Pretty simple.

    Now for the hard part... what I would like to do is make the "Show Spoiler" part of the code an {option} where the user could type [spoiler=Major Movie Ending Spoilers]Insert Spoiler[/spoiler] and have the text on the button say "Major Movie Ending Spoilers."

    While at the same time I want it so that if they just type [spoiler]Insert Spoiler[/spoiler] it will have the default text of "Show Spoiler" on the button.

    I have the code above working properly. I just can't get the option feature working the way I want it, or even know if it's possible. If were to use the {option} code and not type an option, no button shows, not even a button with no text. That could be kind of a problem...

    Any help would be great

  • #2
    Make two, one with, and one with out


    • #3
      Ah... I thought there would be some sort of conflict, but it worked. Thanks a bunch!


      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.