1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

BB Code multiple options

Discussion in 'XenForo Suggestions' started by we_are_borg, Feb 25, 2016.

  1. we_are_borg

    we_are_borg Active Member

    it would be great if we could have the option to allow more then one option in the BB Code. Now you'll need to write a php file to allow this, i think imho that it would be better that Xenforo got this out of the box.
     
  2. Martok

    Martok Well-Known Member

    Can you give a bit more detail about what you mean? Maybe an example of what 'multiple options in BB Code' would look like, or what you are trying to achieve now but can't currently.
     
  3. Chris D

    Chris D XenForo Developer Staff Member

    If you take a quote as an example:
    Code:
    [QUOTE="Martok, post: 1042652, member: 46288"]
    The option in this case is the bit in quotation marks: "Martok, post: 1042652, member: 46288".

    When you use the custom BB code system, it only supports a single option.

    So if you wanted a BB code that would produce a div element with certain colours, with the Custom BB Code system you can do:

    [DIV=red]Blah[/DIV]

    Which is set up like this:
    Code:
    <div style="border-color: {option}; border-size: 1px;">{text}</div>
    Which would produce when used as above:
    HTML:
    <div style="border-color: red; border-size: 1px;">Blah</div>
    But you may want to do something like this:

    [DIV=border-color: X, background-color: Y, color: Z]Blah[/DIV]

    But to process that accordingly, you need to write PHP code to do so. I guess what would be nice is something like:
    Code:
    <div style="{option|1:name}: {option|1:value}; {option|2:name}: {option|2:value}; {option|3:name}: {option|3:value}">{text}</div>
    There's many challenges and considerations to make here, but that gives you the gist of what is being suggested.
     
    Last edited: Feb 25, 2016
    we_are_borg and Martok like this.
  4. we_are_borg

    we_are_borg Active Member

    @Martok its just how @Chris D says by implementing this system in the core it gets easier to make better BB Code that only can do so much. Also people like me that can do a bit PHP work it would mean a great deal. Would be awesome to have the same option in TEXT to then you can bring out lots of nice stuff.
     

Share This Page