Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Thema gestartet von: mf in September 25, 2004, 07:07:18 VORMITTAG

Titel: Category description
Beitrag von: mf in September 25, 2004, 07:07:18 VORMITTAG
If forums have descriptions, isn't it kinda unfair categories don't have them?

On the left, wB forum, on the right, SM forum.
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.mufunyo.net%2Fcategorydescription.png&hash=f157584041bd212a19207cc5c13e41b439418ae2)

Should be a ~really~ easy one, and since I can't think of a way to template mod it, I'm requesting a feature! :)
Titel: Re: Category description
Beitrag von: Burpee in September 25, 2004, 07:57:24 VORMITTAG
Hmm... should definitely be added... I'm amazed this hasn't been asked before...
The only problem with it is that many themes might get messed up if you place an extra line of text there... but I do think people should definitely be given the option.
Titel: Re: Category description
Beitrag von: [Unknown] in September 25, 2004, 03:47:42 NACHMITTAGS
Well, you could name the category:

Encoding<span style="font-size: smaller; font-weight: normal; display: block;">The techie stuff.</span>

That *should* work...

-[Unknown]
Titel: Re: Category description
Beitrag von: mf in September 25, 2004, 04:00:37 NACHMITTAGS
Guess what's the first thing I tried ::). That messes up the tree view.
Titel: Re: Category description
Beitrag von: A.M.A in September 25, 2004, 11:49:23 NACHMITTAGS
How about putting a regexp for ( $tree['name'] ) in the 'theme_linktree' function to delete the <span> tag!
Titel: Re: Category description
Beitrag von: A.M.A in September 26, 2004, 10:15:11 VORMITTAG
in Index.tempalte.php look for
// Show the link, including a URL if it should have one.add after it:$resultTREE = preg_replace('/<span [^>]*>(.*?)<\/span>/', '', $tree['name']);
$tree['name']=$resultTREE;
this will hopefully work, only if you use what [Unknown] suggested above.

when editing the category name it will be messed up .. maybe changing it to a textarea will fix it  :-\
Titel: Re: Category description
Beitrag von: mf in Oktober 04, 2004, 02:57:35 NACHMITTAGS
Sorry for the late reply, but that worked. Thanks!
Titel: Re: Category description
Beitrag von: mf in Oktober 09, 2004, 05:32:43 NACHMITTAGS
Btw, [Unknown]'s suggestion causes a long invisible clickable area that collapses the category, which categories without descriptions don't have (display:block is the culprit). This snippet does it in a cleaner way (and uses the forum theme .css file!):
Encoding<span class="smalltext" style="font-weight:normal;"><br>The techie stuff.</span>
Titel: Re: Category description
Beitrag von: bagel50 in März 02, 2005, 02:19:51 NACHMITTAGS
hmm, I find that the name is cut off after a certain length (short). seems less than ideal to me: It should probably be an extra field, handled separately. Any more information people?

Many thanks,
Olly
Titel: Re: Category description
Beitrag von: Vinspire in Mai 10, 2006, 05:24:41 VORMITTAG
Any screenshot of this trick ? Thanks :)
Titel: Re: Category description
Beitrag von: Stuart in Mai 10, 2006, 08:36:34 VORMITTAG
Zitat von: Vinspire in Mai 10, 2006, 05:24:41 VORMITTAG
Any screenshot of this trick ? Thanks :)

In fact you can see a screenshot in the first post. It shouldn't be much different from the left image  :)
Titel: Re: Category description
Beitrag von: Hoodie in August 11, 2009, 05:44:27 NACHMITTAGS
I know this is old but for this that might want to know, this works 5 years later..