indiePaper

Full Version: Help again :P
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
Well in this theme I am making, I have a cool looking description box in the category box.
[Image: description1.jpg]

My problem: If the category has no description, it looks like this.
[Image: description2.jpg]

Is there a way to fix that?
Can you show us the code portion which does this? I don't know how you're doing it, so I can't really tell.
Sure, should have thought of that Tongue
The code in the template is this:
Code:
<span class="description">{$forum['description']}</span>

And the CSS is this:
Code:
.description {
    background: #0077A3;
    padding: 3px 5px 3px 5px;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    font-size: 11px;
}

Wink
It's possible to do it with JS, but is not really recomended. But I guess you'd have to edit some stuff in MyBB files to make the description to be wraped into a tag when is called from the database, though, that would be a bit complex if you don't know how to modify this (just like me Tongue).

So here's what I'd do with JS, using jQuery of course:

Code:
var description=$(".description").text();
if(description==""){
   $(".description").hide();
}

A really quick fix, but would do the trick.
Thanks, but... Where do I put it? Tongue
Nevermind, somehow when I just put 4 spaces in the description of the category, it goes away Tongue
hmm that's pretty weird Tongue but if it works... I'm guessing it's alright. Just check it in some browser to see if it really works.
Grr, it doesnt work in IE (Obviously) Tongue
TBH, it surprises me that it works in any browser. I don't get how some spaces (which should be rendered as 1 space) can eliminate the padding on an element... but if it works Tongue
I might not even be keeping the theme anyways, it has some problems in IE that make me not want to keep it. Mainly the rounded corners, because I rounded quite alot of the corners and it looks like crap in IE Tongue
Plus some other things in the theme the I wont go into much detail about, but yea, they dont looks good in IE, so I might get rid of it.. Undecided
Pages: 1 2 3 4
Reference URL's