News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Removing Board Name Link from Main Page

Started by Cyber-Box, February 25, 2015, 11:13:45 AM

Previous topic - Next topic

Cyber-Box

At the top of the boards it has:
     Forum Name » Catergory Name » Board Name » Topic Title  (fully extended like this when in topic area)

Is there any way to just remove "Forum Name".  The forum logo is the name...AND the first category is also the name...so it just keeps repeating.  And I don't even mind, it's just in the main page it has the forum name  "just there".  LOL  Idk if you know what I mean.  It's just that I have this real nice looking theme from StudioCrimes but that link right THERE irks me.  LOLOL   ;D

Kindred

it is intended to be there.... it's called "breadcrumbs" (or linktree) and every site that has a logical structure tends to use one....., with the "homepage" being the first in the list of breadcrumbs


to change it, you would have to change the linktree build routine...  I think it's in load.php (might be in subs.php)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

margarett

SMF shows 2 linktrees: one on top and another on the bottom. The bottom one is only shown in some places.

Since the linktree is actually filled in several places (depending on where you are in your forum), the best way to adjust that would be in index.template.php, function "theme_linktree"

This is the original function:
function theme_linktree($force_show = false)
{
global $context, $settings, $options, $shown_linktree;

// 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.
foreach ($context['linktree'] as $link_num => $tree)
{
echo '
<li', ($link_num == count($context['linktree']) - 1) ? ' class="last"' : '', '>';

// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];

// Show the link, including a URL if it should have one.
echo $settings['linktree_link'] && isset($tree['url']) ? '
<a href="' . $tree['url'] . '"><span>' . $tree['name'] . '</span></a>' : '<span>' . $tree['name'] . '</span>';

// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];

// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo ' &#187;';

echo '
</li>';
}
echo '
</ul>
</div>';

$shown_linktree = true;
}


Something like this should work.

function theme_linktree($force_show = false)
{
global $context, $settings, $options, $shown_linktree;

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

//Strip out the first position of the linktree -- Main forum link. If we got here, linktree has at least 2 items, will loose the first
array_shift($context['linktree']);

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

// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
echo '
<li', ($link_num == count($context['linktree']) - 1) ? ' class="last"' : '', '>';

// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];

// Show the link, including a URL if it should have one.
echo $settings['linktree_link'] && isset($tree['url']) ? '
<a href="' . $tree['url'] . '"><span>' . $tree['name'] . '</span></a>' : '<span>' . $tree['name'] . '</span>';

// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];

// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo ' &#187;';

echo '
</li>';
}
echo '
</ul>
</div>';

$shown_linktree = true;
}
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

Kindred

wouldn't it be better to alter the linktree array in the source rather than the template?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor


Cyber-Box


sukafia

Wow! Thanks that worked magic however on my site it only took out one of them, I wish to take out the 2nd also. I've attached a screenshot for clarification. Thanks

Note: there where two site name appearing,  one was a link the other just text, now the link isn't showing but the text is still showing. I wish to take it out. Thanks

sukafia

Thanks guys I figured it out. Inspected the code seems like what I need to take out was in the header. Cheers!

Advertisement: