• 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

cclaerhout

Well-known member
#1
I know it's not a bug, but it's really annoying. Before (with vB) the align bbcodes were using these commands:
HTML:
<div align="left">my code</div>
HTML:
<div align="center">my code</div>
HTML:
<div align="right">my code</div>
Now it's using the text-align css command
HTML:
<div style="text-align:left">my code</div>
HTML:
<div style="text-align:center">my code</div>
HTML:
<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:
HTML:
<div style="text-align:center; width:150px">
<img src="link_to_image" style="width:150px" /><br />
<span>Image Caption</span>
</div>
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".
 

Kier

XenForo Developer
Staff member
#5
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.
 

pegasus

Well-known member
#11
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.
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.
 

Chris D

XenForo developer
Staff member
#12
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.
 

cclaerhout

Well-known member
#13
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.
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: