Coloured imported Text

Hi,

Have been running new hosted Discourse based forum for a month now. Very impressed. We have already 2000 users.

Bringing coloured text from previous phpBB forum, but cant get it to work in new forum:
[color=#BFBFBF]grey-“Ready to update”[/color], [color=#FF8000]orange - old number [/color]or [color=#00BF00]green - current number[/color].

Any suggestions are appreciated.

1 Like

Have you considered using the BBCode plugin?

1 Like

Can this be used for a hosted forum?

1 Like

When we imported nearly a million posts from vB to Discourse, we stripped out all the color bbcode during the migration process.

Our problem was that the BBCODE plugin does not work as expected when the BBCODE is nested (BBCODE inside BBCODE), and so after a lot of analysis on this, we decided to strip out all color BBCODE tags (recursively) during the migration process.

Nested BBCODE is really messy to import, obviously! It is “doable” but we decided it was not worth the effort (and adding little value because named color fonts, versus classes, makes theming difficult).

Hope this helps.

1 Like

Is mine nested (BBCODE inside BBCODE)?
Is there any alternative to get coloured text?

1 Like

No, you need to use BBCode. You can nest but only if it makes sense (not unlike HTML). There may be some unimplemented codes.

My Discourse Frotz plugin uses nesting successfully to combine font, colour and background colour. Note the red ‘N’ letter on the compass on the screenshot.

You’d need to ask your hoster if they can install that official plugin.

1 Like

Hey @ianm

The code sample you provided is not nested.

Our experience with the official BBCODE plugin was that it does not “play well” with nested BBCODE. However, if you do not have nested BBCODE, this is “more-than-likey” not an issue for your migration.

Our site migration had decades of nested BBCODE (hundreds of thousands) and it was a huge problem (even with the official BBCODE plugin, which we use today) so, we just stripped all the color (and some other code tags we did not need away). Not one user has complained text color from a post 5 years old is missing and nor will they.

Getting migrated BBCODE to work properly is NOT so simple like “use the official BBCODE plugin”. If a big migration of years of various combinations of nested BBCODE was that simple, our full migration time would have been weeks versus months. It’s something to experience first-hand and is not “a theory”, it is just how it is. The official BBCODE plugin is nice, and we use it, but only after stripping out much of the nested BBCODE.

We also made the decision to strip out all color BBCODE tags (completely) because when a color is hard coded into the text, it might look OK with one theme (a light theme for example), but the same color will not look good, and will often be a distraction on another theme (for example a dark theme), so we made the decision to strip all the color BBCODE tags and we are very happy we did.

Of course, each site has to make their own tradeoff choices during migration. I can tell we had some “very smart REGEX guys” writing for months to get our migration “perfect” and most of the time spent was because of BBCODE. The official plugins and gems for this were a good “first approximation” but left a lot to be desired in the final migration, so we wrote a lot of Ruby gsub() REGEX to clean it up.

Best of luck and hope this practical view “from the battlefield of migration” was helpful. There is no doubt that migrating from one legacy forum to another can be very “tricky” if your goal is a “Great Looking” migration versus a kind of “sloppy migration”.

Your code works fine in the BBCode plugin as is:

here, I’ve added one level of nesting:

how about two?:

how about three, and a bit more of a complex set:

Thank you for confirming it works in that plugin. I shall see if it can be added to our hosted forum :thinking:

1 Like

I’m sorry but, the BBCode plugin is not available on either our Standard or Business plans. The plugins available on each of those plans are listed here: Plugin directory | Discourse - Civilized Discussion.

The BBCode plugin and any other official Discourse plugins can be installed on our Enterprise plan though.

2 Likes