How to hide index linktree

Started by blow, August 11, 2010, 05:15:58 PM

Previous topic - Next topic

blow

Is it possible to hide the linktree only on the forum index?
Just because it's not that useful to have a single link to the index at the top of the index.  :P

Thanks in advance.

(I'm using RC3.)

Oranos

Sure, open up Load.php

find
// Set the top level linktree up.
array_unshift($context['linktree'], array(
'url' => $scripturl,
'name' => $context['forum_name_html_safe']
));


replace with

// Set the top level linktree up.
if(!empty($_GET))
array_unshift($context['linktree'], array(
'url' => $scripturl,
'name' => $context['forum_name_html_safe']
));


should be around lines  1572 - 1578 of Load.php

EDIT:

This is assuming you don't have a portal installed.

blow


IchBin™

It would probably be better to edit the index.template.php file instead of a source file.

In index.template.php where the "function theme_linktree()" is defined you can add something like this after the global line:
    if (count($context['linktree'])<2)
        return;
IchBin™        TinyPortal

blow

@IchBin™:
Ok. That worked very well, but please check if put it on the right place:

// Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree($force_show = false)
{
global $context, $settings, $options, $shown_linktree;

if (count($context['linktree'])<2)
return;

// If linktree is empty, just return - also allow an override.
if (empty($context['linktree']) || (!empty($context['dont_default_linktree']) && !$force_show))
return;

echo '
<div class="navigate_section">
<ul>';

// Each tree item has a URL and name. Some may have extra_before and extra_after.

IchBin™

IchBin™        TinyPortal

blow


Advertisement: