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

Fixed Xenforo Align [left] [center] [right] bbcodes with new bbcodes

Discussion in 'Resolved Bug Reports' started by cclaerhout, Mar 19, 2012.

  1. cclaerhout

    cclaerhout Well-Known Member

    I know it's not a bug, but it's really annoying. Before (with vB) the align bbcodes were using these commands:
    <div align="left">my code</div>
    <div align="center">my code</div>
    <div align="right">my code</div>
    Now it's using the text-align css command
    <div style="text-align:left">my code</div>
    <div style="text-align:center">my code</div>
    <div style="text-align:right">my code</div>
    The problem?
    It's working with text, even images, but if you created a bbcode using for example that very simple code:
    <div style="text-align:center; width:150px">
    <img src="link_to_image" style="width:150px" /><br />
    <span>Image Caption</span>
    Then, the caption and image will be align center inside the div container of 150 pixels, but if this div container is wrapped inside the XenForo [ center ] bbcode, it won't be center inside the post as it used to be with a center bbcode using html "align=center".
  2. cclaerhout

    cclaerhout Well-Known Member

    Example here.

    Attached Files:

    • demo.png
      File size:
      24.2 KB
  3. samresp

    samresp New Member

    I'm having the same issue for images floating left/right . any suggestion?
  4. cclaerhout

    cclaerhout Well-Known Member

    There is an option with this addon to give those tags their old behaviour.
  5. Kier

    Kier XenForo Developer Staff Member

    I think in this particular case, the HTML align attribute gives results that are more predictable for end users than the CSS 'equivalents', so I'll change it in the core.
  6. cclaerhout

    cclaerhout Well-Known Member

    Thanks a lot Kier.
  7. Strong

    Strong Member

    So how does one float and align images?
  8. Brogan

    Brogan XenForo Moderator Staff Member

  9. cclaerhout

    cclaerhout Well-Known Member

    These properties must be directly integrated to your Bb Code (ref: bimg Bb Code from this addon / Github file - line 61).
  10. Strong

    Strong Member

  11. pegasus

    pegasus Well-Known Member

    Did you mean that you are implementing a closer CSS 'equivalent' in core? Because my understanding is that the align attribute itself is no longer supported in HTML5.
  12. Chris D

    Chris D XenForo Developer Staff Member

    The post is over 2 years old. Certainly the current align BB Codes don't use the align attribute, so there's nothing to worry about there.

    Curiously, though, the current align solution is the same that was reported as a bug originally so either another solution was found or the original solution was re-implemented based on the deprecation of that in HTML5.
  13. cclaerhout

    cclaerhout Well-Known Member

    Every Bb Codes that are using a block container should implement itself in its options some alignment options and not use the default paragraph alignment. That's a difference with previous scripts developed on vBulletin but that's the easiest and cleanest solution.
    Last edited: Jul 25, 2014

Share This Page