News:

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

Main Menu

How to Remove Board and Category (ID) in BoardIndex.template.php?

Started by Argon3000, December 24, 2013, 08:23:49 AM

Previous topic - Next topic

Argon3000

Hi,

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


Themes/theme_name/BoardIndex.template.php

SMF 2.0.15, PortaMx-SEF 1.54

kat



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. :(

Argon3000

SMF 2.0.15, PortaMx-SEF 1.54

kat

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?

Argon3000

No.

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

SMF 2.0.15, PortaMx-SEF 1.54

Sorck

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):
foreach ($category['boards'] as $board)
{

You could add the following on the line after the above code:

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.

Argon3000

SMF 2.0.15, PortaMx-SEF 1.54

Argon3000


Remove certain category (known ID of the category) in the file Themes/theme_name/BoardIndex.template.php
$category['id']   ?
SMF 2.0.15, PortaMx-SEF 1.54

Sorck

You'll need to move up a loop for that.

It'll look something like
foreach ($context['categories'] as $category)
{

And then after that you can put:
if ($category['id'] === 1337)
continue;

Argon3000

Removed all the boards in this category.
How to Removed a category, but the boards were on the page?
SMF 2.0.15, PortaMx-SEF 1.54

Sorck

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 if($category['id'] !== 1337) {
// existing code here
}


In the default theme the "existing code" would be:
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>';

margarett

Why don't you just move those boards to another category? It makes no sense to have boards under no category, methinks...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

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

kat

I find the whole concept of what's going on, here, a bit worrying, to be honest.

Sorck

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.

Quote from: margarett 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...
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.


Advertisement: