Uutiset:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu
Advertisement:

Forum category - default to collapsed?

Aloittaja triom, syyskuu 20, 2013, 11:31:56 IP

« edellinen - seuraava »

triom

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?

Sir Osis of Liver

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.

When in Emor, do as the Snamors.
                              - D. Lister

Sir Osis of Liver


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

Hmmm......

When in Emor, do as the Snamors.
                              - D. Lister

Arantor

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.
Holder of controversial views, all of which my own.


Sir Osis of Liver

When in Emor, do as the Snamors.
                              - D. Lister

triom

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.


triom

Yes, it does, but only for guest users.  I just tried it.  I'd like the category to be collapsed by default for everyone. 

triom

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.

Advertisement: