XF 1.3 Highlight Text BB Code

BizBuzz

Member
Hello,

I finally took the plunge over the weekend, and purchased Xenforo. Been having fun with the set up, and this support forum is invaluable.

I am pretty good with finding answer, but have been stumped for more than a few hours with this one.

I am trying to find a way to just add highlighting (I guess another term is BG?) to BB Codes. I have visited this thread, and I tried to follow the directions, and I can't make it work, and don't know what I am doing wrong.

I have also been to the Custom BB Code Manager and just feel that is too much for me because all I really want to add is a Highlight Text BB Code.

Am I just whistling Dixie?

Can this simple thing be done in the Custom BB Code > Add New Custom BB Code

Help? Thanks!
 
Brogan, I did not mean to suggest that there was anything missing in your answer, but when I saw the word "yellow" replacing the word "option" I was pretty sure JamesBrown did not understand their usage.

Is the class declaration a requirement or just good practice?

I ask because I will be moving some our existing vB4 bbCodes to our new XenForo site.
 
Declaring a class isn't necessary, it can be done with inline styling.

Doing it as a class though allows custom styling to be set per style, should that be desired/necessary.
 
Nice to know its working for you :) When I use that all I get is this BB code in my post

[BG=]whatevertext[/BG]

Nothing is highlighted and the BB Code is shown.
 
Last edited:
If there is no option it's [BG].

If there is an option it's [BG=colour].

What you are doing -- [BG=] -- is a combination of the two but incorrect.
 
If there is no option it's [BG].

If there is an option it's [BG=colour].

What you are doing -- [BG=] -- is a combination of the two but incorrect.

Sorry Brogan I don't understand, over the last couple of years I have tried it "exactly" as is written by you in your example, exactly as others have done. I have copied your example many times over thinking I must have done something wrong, I've had others check that its the same as yours. But all I get is BB Code posted in the thread.
 
Why don't you want to enter the color code after the equal sign? I believe it will work with any legal html color code.

Where you enter [BG=] it should be [BG=yellow]. This not in the definition of the BB code, but in the usage in your post.

I think you may still have the made up class definition in your BBcode definition also. If that class is not in the template, the substitution will not occur, will it?
 
Last edited:
Which = sign ?

I really have no idea :) I have this where it say html replacement: (whatever that is)

<span class=funbbcodebg” style=“background-color: {option}”>{text}</span>

What do I have to do to have just a simple yellow background?
 
Code:
<span class="funbbcodebg">{text}</span>

EXTRA.css
Code:
funbbcodebg
{
        background-color: yellow;
        padding: 1px 2px;
}

But that makes it style dependent (will only work in the styles you add the CSS to the EXTRA.css).

So

HTML Replacement
Code:
<span class="funbbcodebg" style="background-color: yellow; padding: 1px 2px;">{text}</span>

The above requires no EXTRA.css.

Also, it seems you are using a reversed quotation mark which will not parse.

Correct: "
Incorrect:
 
When you are typing youor message where you want the background, how do you get the BBcode? The easiest way is to type the characters [BG=yellow]Text with a yellow background[/BG].

It is not a WYSIWYG interface. When you click on Post Reply, you should see the yellow background.
 
When you are typing youor message where you want the background, how do you get the BBcode? The easiest way is to type the characters [BG=yellow]Text with a yellow background[/BG].

It is not a WYSIWYG interface. When you click on Post Reply, you should see the yellow background.

When I use the editor and I select text and make it bold or italic. I see the emboldened or italicised text there in the editor, not the underlying BB Code. Is it possible to do this with the custom BB code?
 
Top Bottom