TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

April 19, 2024, 11:04:39 PM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,165
  • Total Topics: 21,219
  • Online today: 266
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 131
  • Total: 132
  • @rjen

Linktree questions ~ Hide Linktree on FrontPage

Started by Chair, April 13, 2010, 07:20:53 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

SN

I would like to remove the Linktree from the font page (only) also

i don't like the method Chair suggest personally, because i want to keep the title on the forum index

can anybody help?

IchBin

The linktree is theme dependent. If it's on every page, that means it's in your index.template.php. If you don't want it on every page, you'll have to edit your template files to reflect which pages you want it to display on.

SN

I don't want it on the Front page, all other pages are fine.

how would i hide it from the frontpage


IchBin

Depends on what theme you're using. Remove it from the index.template.php template_above function. Add it to the other templates that you want it in.

SN

Thanks Ich, but i have no idea how to do that.

I thought it would have been inside of a TP file, then it was a option of just deleting a code.

so i guess i will just leave it there

IchBin

Actually duh.... I don't know why I wasn't thinking about this, but you should be able to do some PHP to make it not display. What is the theme you are using? Can you post the code where the linktree is displayed in the index.template.php file?

SN

Oh ok ich lol I'm Using Silent Wave Theme Dziner Studio.

I think the code is this:

// 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 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 ' Ã,»';

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

$shown_linktree = true;
}

IchBin

No, that is where the function is defined. You need to search for where the function is called. theme_linktree()

bloc

I think I used a simple check in one of my themes: just check if items in linktree is above 1 or not. On the frontpage it will be just one item anyway. So you could insert this line inside the theme_linktree() function and see if it works(it will need to go after the first "if" in your function)


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

SN

Quote from: IchBinâ„¢ on April 20, 2010, 03:54:42 PM
No, that is where the function is defined. You need to search for where the function is called. theme_linktree()
Is this the code Ich?

// Show the navigation tree.

theme_linktree();
}

function template_body_below()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

echo '

</div>

Quote from: Bloc on April 20, 2010, 03:59:35 PM
I think I used a simple check in one of my themes: just check if items in linktree is above 1 or not. On the frontpage it will be just one item anyway. So you could insert this line inside the theme_linktree() function and see if it works(it will need to go after the first "if" in your function)


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


I don't really understand that bloc, im pretty useless with php, are u talking about the code i post earlier?