Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Aiheen aloitti: triom - syyskuu 20, 2013, 11:31:56 IP

Otsikko: Forum category - default to collapsed?
Kirjoitti: triom - syyskuu 20, 2013, 11:31:56 IP
I'd like to add a new Category of forums but I'd like it to be collapsed by default (whereas I want the other Categories to be expanded by default).  Any ideas how I can accomplish this?
Otsikko: Re: Forum category - default to collapsed?
Kirjoitti: Sir Osis of Liver - syyskuu 20, 2013, 11:57:02 IP
In BoardIndex.template.php -



// If theres no parent boards we can see, avoid showing an empty category (unless its collapsed)

echo '$category[\'id\'] = ' . $category['id'];

if ($category['id'] == 3)
$category['is_collapsed'] = 1;

if (empty($category['boards']) && !$category['is_collapsed'])
continue;



First new line will print a list of category id's, pick the one you want and put it in the if statement, then delete the echo statement.

Otsikko: Re: Forum category - default to collapsed?
Kirjoitti: Sir Osis of Liver - syyskuu 21, 2013, 12:05:31 AP

Oops, check that.  You can't uncollapse it.

Hmmm......

Otsikko: Re: Forum category - default to collapsed?
Kirjoitti: Arantor - syyskuu 21, 2013, 12:08:40 AP
There's not really a good way of doing that without putting a new row in the collapsed_categories table every time a new user registers... and that ain't exactly pretty either.
Otsikko: Re: Forum category - default to collapsed?
Kirjoitti: Sir Osis of Liver - syyskuu 21, 2013, 12:10:18 AP

Try this -

http://custom.simplemachines.org/mods/index.php?mod=1267

Otsikko: Re: Forum category - default to collapsed?
Kirjoitti: triom - syyskuu 21, 2013, 03:00:05 AP
Thanks, I will check that mod out.  From the description it looks like it applies only for guests.  I would want it to apply to all.  What I want to do is have an Archive category (collapsed by default) that has several read-only forums in it.
Otsikko: Re: Forum category - default to collapsed?
Kirjoitti: Hammersmith - syyskuu 21, 2013, 09:13:03 AP
Lainaus käyttäjältä: Krash. - syyskuu 21, 2013, 12:10:18 AP

Try this -

http://custom.simplemachines.org/mods/index.php?mod=1267
.
This mod allows to set any of the categories to a default collapsed
Otsikko: Re: Forum category - default to collapsed?
Kirjoitti: triom - syyskuu 21, 2013, 10:57:01 AP
Yes, it does, but only for guest users.  I just tried it.  I'd like the category to be collapsed by default for everyone. 
Otsikko: Re: Forum category - default to collapsed?
Kirjoitti: triom - syyskuu 21, 2013, 11:02:31 AP
I think I might reorganize all the archived forums as Child Boards in 1 forum in 1 category.  That might meet my needs of having all that content accessible but out of the way.