Advertisement:

Author Topic: Category description  (Read 26542 times)

Offline mf

  • Semi-Newbie
  • *
  • Posts: 28
  • Gender: Male
  • ...Spare Change?
    • Quack Quack Quack
Category description
« on: September 25, 2004, 07:07:18 AM »
If forums have descriptions, isn't it kinda unfair categories don't have them?

On the left, wB forum, on the right, SM forum.


Should be a ~really~ easy one, and since I can't think of a way to template mod it, I'm requesting a feature! :)

Offline Burpee

  • SMF Friend
  • Sophist Member
  • *
  • Posts: 1,298
  • Gender: Male
    • Mafan.nl
Re: Category description
« Reply #1 on: September 25, 2004, 07:57:24 AM »
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.

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Category description
« Reply #2 on: September 25, 2004, 03:47:42 PM »
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]

Offline mf

  • Semi-Newbie
  • *
  • Posts: 28
  • Gender: Male
  • ...Spare Change?
    • Quack Quack Quack
Re: Category description
« Reply #3 on: September 25, 2004, 04:00:37 PM »
Guess what's the first thing I tried ::). That messes up the tree view.

Offline A.M.A

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,133
  • Gender: Male
  • ..
Re: Category description
« Reply #4 on: September 25, 2004, 11:49:23 PM »
How about putting a regexp for ( $tree['name'] ) in the 'theme_linktree' function to delete the <span> tag!
Really sorry .. real life is demanding my full attention .. will be back soon hopefully :)

Offline A.M.A

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,133
  • Gender: Male
  • ..
Re: Category description
« Reply #5 on: September 26, 2004, 10:15:11 AM »
in Index.tempalte.php look for
Code: [Select]
// Show the link, including a URL if it should have one.add after it:
Code: [Select]
$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  :-\
Really sorry .. real life is demanding my full attention .. will be back soon hopefully :)

Offline mf

  • Semi-Newbie
  • *
  • Posts: 28
  • Gender: Male
  • ...Spare Change?
    • Quack Quack Quack
Re: Category description
« Reply #6 on: October 04, 2004, 02:57:35 PM »
Sorry for the late reply, but that worked. Thanks!

Offline mf

  • Semi-Newbie
  • *
  • Posts: 28
  • Gender: Male
  • ...Spare Change?
    • Quack Quack Quack
Re: Category description
« Reply #7 on: October 09, 2004, 05:32:43 PM »
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>
« Last Edit: October 09, 2004, 05:34:30 PM by mf »

Offline bagel50

  • Newbie
  • *
  • Posts: 1
Re: Category description
« Reply #8 on: March 02, 2005, 02:19:51 PM »
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

Offline Vinspire

  • Sr. Member
  • ****
  • Posts: 852
  • Gender: Male
    • The Box Of Heart Forum
Re: Category description
« Reply #9 on: May 10, 2006, 05:24:41 AM »
Any screenshot of this trick ? Thanks :)

Offline Stuart

  • Full Member
  • ***
  • Posts: 421
Re: Category description
« Reply #10 on: May 10, 2006, 08:36:34 AM »
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  :)

Offline Hoodie

  • Jr. Member
  • **
  • Posts: 158
  • Gender: Male
Re: Category description
« Reply #11 on: August 11, 2009, 05:44:27 PM »
I know this is old but for this that might want to know, this works 5 years later..