indiePaper MyBB Premium Themes

Toggle Panel

Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help again :P
10-01-2009, 07:37 PM
Post: #1
Help again :P
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?

Visit this user's website Find all posts by this user
Quote this message in a reply
10-01-2009, 09:16 PM
Post: #2
RE: Help again :P
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.

Find all posts by this user
Quote this message in a reply
10-01-2009, 10:30 PM
Post: #3
RE: Help again :P
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

Visit this user's website Find all posts by this user
Quote this message in a reply
10-04-2009, 06:55 PM
Post: #4
RE: Help again :P
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.

Find all posts by this user
Quote this message in a reply
10-05-2009, 11:14 AM
Post: #5
RE: Help again :P
Thanks, but... Where do I put it? Tongue

Visit this user's website Find all posts by this user
Quote this message in a reply
10-05-2009, 01:34 PM
Post: #6
RE: Help again :P
Nevermind, somehow when I just put 4 spaces in the description of the category, it goes away Tongue

Visit this user's website Find all posts by this user
Quote this message in a reply
10-05-2009, 07:52 PM
Post: #7
RE: Help again :P
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.

Find all posts by this user
Quote this message in a reply
10-06-2009, 08:41 PM
Post: #8
RE: Help again :P
Grr, it doesnt work in IE (Obviously) Tongue

Visit this user's website Find all posts by this user
Quote this message in a reply
10-06-2009, 09:01 PM
Post: #9
RE: Help again :P
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

Find all posts by this user
Quote this message in a reply
10-14-2009, 08:19 PM
Post: #10
RE: Help again :P
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

Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: