Advertisement:

Author Topic: How to Remove Board and Category (ID) in BoardIndex.template.php?  (Read 5284 times)

Offline Argon3000

  • Newbie
  • *
  • Posts: 7
Hi,

Please can someone tell me. How to Remove Parent Board (ID)?


Themes/theme_name/BoardIndex.template.php

« Last Edit: December 24, 2013, 10:49:51 AM by Argon3000 »

Offline K@

  • Lead Support Specialist
  • SMF Master
  • *
  • Posts: 46,634
  • Gender: Male
  • Yum!
Re: How to Remove Parent Board (ID)?
« Reply #1 on: December 24, 2013, 08:45:22 AM »


Sorry, Argon. I'm not, entirely, sure what you mean by "Parent board (ID)".

The part you've crossed-out seems to be an actual board So, I'm a little confused. :(

Offline Argon3000

  • Newbie
  • *
  • Posts: 7
Re: How to Remove Parent Board (ID)?
« Reply #2 on: December 24, 2013, 08:55:34 AM »
Sorry, K@.

Remove Board.

Offline K@

  • Lead Support Specialist
  • SMF Master
  • *
  • Posts: 46,634
  • Gender: Male
  • Yum!
Re: How to Remove Parent Board (ID)?
« Reply #3 on: December 24, 2013, 09:01:07 AM »
So, have I got this right? You want to see the categories, but none of the boards?

I must have that wrong, surely?

In the bar, with the category name, you'll see a "-" sign, on the far right. If you click that, it'll collapse the boards, in that category, so that you can't see them.

Is that what you want to see?

Offline Argon3000

  • Newbie
  • *
  • Posts: 7
Re: How to Remove Parent Board (ID)?
« Reply #4 on: December 24, 2013, 09:06:23 AM »
No.

Remove certain board (known ID of the board) in the file Themes/theme_name/BoardIndex.template.php


Offline Sorck

  • Jr. Member
  • **
  • Posts: 260
  • Gender: Male
  • Is it a bird? Is it a plane? Of course it's not.
    • Second Sphere
Re: How to Remove Parent Board (ID)?
« Reply #5 on: December 24, 2013, 09:12:34 AM »
So you want to hide it on the board index so you can't see it on that list, but you still want the board to exist?

In BoardIndex.template.php you'll have the following two lines (or something similar):
Code: [Select]
foreach ($category['boards'] as $board)
{
You could add the following on the line after the above code:
Code: [Select]
if ($board['id'] === 1337)
continue;
Replacing 1337 with your board ID. This means that the board in question shouldn't display on your board index anymore, but will still exist (so it will appear in unread posts and the likes).


However, if you want to delete the board entirely, go to Admin -> Forum -> Boards and you can modify/delete your board through there.

Offline Argon3000

  • Newbie
  • *
  • Posts: 7
Re: How to Remove Parent Board (ID)?
« Reply #6 on: December 24, 2013, 10:42:28 AM »
OK! Thank you! It works!  :)

Offline Argon3000

  • Newbie
  • *
  • Posts: 7
Re: How to Remove Parent Board (ID)?
« Reply #7 on: December 24, 2013, 10:48:19 AM »

Remove certain category (known ID of the category) in the file Themes/theme_name/BoardIndex.template.php
$category['id']   ?

Offline Sorck

  • Jr. Member
  • **
  • Posts: 260
  • Gender: Male
  • Is it a bird? Is it a plane? Of course it's not.
    • Second Sphere
Re: How to Remove Board and Category (ID) in BoardIndex.template.php?
« Reply #8 on: December 24, 2013, 11:19:52 AM »
You'll need to move up a loop for that.

It'll look something like
Code: [Select]
foreach ($context['categories'] as $category)
{
And then after that you can put:
Code: [Select]
if ($category['id'] === 1337)
continue;

Offline Argon3000

  • Newbie
  • *
  • Posts: 7
Re: How to Remove Board and Category (ID) in BoardIndex.template.php?
« Reply #9 on: December 24, 2013, 11:40:52 AM »
Removed all the boards in this category.
How to Removed a category, but the boards were on the page?

Offline Sorck

  • Jr. Member
  • **
  • Posts: 260
  • Gender: Male
  • Is it a bird? Is it a plane? Of course it's not.
    • Second Sphere
Re: How to Remove Board and Category (ID) in BoardIndex.template.php?
« Reply #10 on: December 24, 2013, 11:49:28 AM »
You want to remove only the bit which says what the category is called?

You need to find the bit which output that and wrap it with
Code: [Select]
if($category['id'] !== 1337) {
// existing code here
}

In the default theme the "existing code" would be:
Code: [Select]
echo '
<tbody class="header" id="category_', $category['id'], '">
<tr>
<td colspan="4">
<div class="cat_bar">
<h3 class="catbg">';

// If this category even can collapse, show a link to collapse it.
if ($category['can_collapse'])
echo '
<a class="collapse" href="', $category['collapse_href'], '">', $category['collapse_image'], '</a>';

if (!$context['user']['is_guest'] && !empty($category['show_unread']))
echo '
<a class="unreadlink" href="', $scripturl, '?action=unread;c=', $category['id'], '">', $txt['view_unread_category'], '</a>';

echo '
', $category['link'], '
</h3>
</div>
</td>
</tr>
</tbody>';

Online margarett

  • Support Specialist
  • SMF Super Hero
  • *
  • Posts: 11,325
  • Gender: Male
Re: How to Remove Board and Category (ID) in BoardIndex.template.php?
« Reply #11 on: December 24, 2013, 01:03:03 PM »
Why don't you just move those boards to another category? It makes no sense to have boards under no category, methinks...
Bruno Alves a.k.a "margarett"

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

Quote
Over 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Offline K@

  • Lead Support Specialist
  • SMF Master
  • *
  • Posts: 46,634
  • Gender: Male
  • Yum!
Re: How to Remove Board and Category (ID) in BoardIndex.template.php?
« Reply #12 on: December 24, 2013, 02:20:59 PM »
I find the whole concept of what's going on, here, a bit worrying, to be honest.

Offline Sorck

  • Jr. Member
  • **
  • Posts: 260
  • Gender: Male
  • Is it a bird? Is it a plane? Of course it's not.
    • Second Sphere
Re: How to Remove Board and Category (ID) in BoardIndex.template.php?
« Reply #13 on: December 24, 2013, 03:06:32 PM »
Thinking about why this could be useful has reminded me of a trick which does the 'hidden' board thing within SMF. If you create a board that nobody can view, you can then put a child board which people have permissions to view. They can then see the board through unread messages or directly but not through the board index.

Though I do agree that obscuring a board is an odd thing to do in general.

Why don't you just move those boards to another category? It makes no sense to have boards under no category, methinks...
It looks like it'll break the layout a bit within the category header. Well, it'll still render but won't look quite right.

Offline Argon3000

  • Newbie
  • *
  • Posts: 7