MyBB Community Forums

Full Version: Custom Templates
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
(2014-09-04, 02:55 AM)jshort Wrote: [ -> ]No problem. Smile I gave it a try on my test board and it worked out fine, so hopefully it does for you too.

I totally updated the post before yours before I saw this.

<style>.avepost { width: 400px; text-align: justify; padding 20px; font-family: Tahoma; color: #000; font-size: 12px; margin: 0 auto; line-height: 150%; } .avepost span { color: #81306F; } .avepost i { color: #A98894; } </style>

<div class="avepost">$1</div>

How would I go about making the italics color and still be italics?
It colors as the bold text should. But my codes have their own colors for each, so now I'm confused. again, haha.
Are you trying to include the CSS in the myCode itself? That won't work because myBB completely strips out <style> tags in posts. You need to include it in your global.css file. Your outputted HTML when you test your myCode should only be <div class="avepost">$1</div> or whatever it might be. Since you need to include classes, test it on the actual forum and see what happens.

You would target the italics the same way, using .avepost span. If you want the bold and the italics to have different colors, then you'll need to make a myCode. It's a pain, but since that's how myBB parses bold and italic tags, there isn't too much choice otherwise.

Let me test it real quick and I'll edit my post to let you know.

Edit:

Okay, so here's what you do:

In global.css,
.avepost { width: 400px; text-align: justify; padding 20px; font-family: Tahoma; color: #000; font-size: 12px; margin: 0 auto; line-height: 150%; } .avepost span { color: #81306F; } .avepost i { color: #A98894; } 

Italic myCode Regular Expression
\[italics\](.*?)\[/italics\]

Replacement
<i>$1</i>

So if your post looks like this:

[rules]this is normal text [b]bold. this is going to use the span color as defined in your css[/b]. Using the [i]tag will also give the same color as in your .avepost span[/i]. However, using [italics]this text will be the color defined in your .avepost i[/italics]. But only if it is included in the rules tag.[/rules]

Does that make sense? It's a really roundabout and inconvenient way to do it, but because the myCode for bold and italics aren't processed with <b> and <i>, there isn't a lot of other choices.
Actually, the mycode is working with the style tags just fine.

But I did do it from the style sheet.

How would I go about making a mycode for the italics then?

Alright. Now, in theory, that italics mycode should work with every template that I have that colors it's italics, correct? As a RPGer, I'm a total nerd and like my thoughts and dialogue different colors so that I can see them better.
Oh I never imagened you were using the style tag in MyCode fields.
I'm an RPer too, so I totally get it. Smile

Yep! It should work, you'll just need to include the outer [rules] (or whatever you renamed it) first, so it knows which CSS class to look at.
(2014-09-04, 03:30 AM)Omar G. Wrote: [ -> ]Oh I never imagened you were using the style tag in MyCode fields.

I was, actually. I have seen it done through a friend and, initially, it worked. But I really like using my stylesheets for stuff rather than having to go and redo everything to make it all pretty. 
Pages: 1 2