News:

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

Main Menu

Remove linktree from front page

Started by netroutes, July 12, 2008, 01:21:25 PM

Previous topic - Next topic

netroutes

I've just discovered SMF and started using it. I am very impressed with it, and love it, but there's this one little thing that bugs me (isn't there always?).

I don't see the need for the linktree on the front page. If you remove it, it disappears from ALL pages (at least in the attempts I made), which is even worse, of course.

I would like to see future version either not have it at all, or at least have an option in settings to have the front page linktree-free.

I have a Fantastico install, and would like to avoid editing core files, to make updates easlier, but I really dislike the repetition on the front page.

Forgive me if this has already been covered. I did search, but found nothing to this specific issue.

Nathaniel

You should only need to remove it from the BoardIndex.template.php file, remove the part near the beginning which should be similar to this for the default theme.
<td valign="bottom">', theme_linktree(), '</td>
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

netroutes

Thanks, but unfortunately, the theme I've chosen doesn't have that a file for board index like the core default. Is there a guide to recreating these, can I just plop the default version into my theme's directory, or what?

Nathaniel

If the theme that you are trying to change doesn't have one, then it uses the one from the default template by default anyway, just 'plop' or put the default version into your theme's directory and make the necessary change to that file.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Vveb.ws

Hello !
My question is more difficult  :-[

I finded by word "LINKTREE", but have finded only 2 topics for this question - this and this:
Inline Link Format Suggestion


How can remove unnecessary part of the path 'linktree_link' Name Forum and category?

By default, the path appears as follows:
Site Name > Category Name > Name Forum > Subforums Name > Topic Name
A person can get confused!

Unnecessary path elements:
Site Name > duplicates the first tab "Home"
Category Name > useless link, again links to index :)

I need to make the path:
Forum Name > Subforums Name > Topic Name

Arantor

Category Name isn't actually an unnecessary link, though it can be undesirable - apart from telling users where the post is, it actually links to the category itself - try it on this site, you'll see it'll take you to the part of the front page where the category is; on larger forums it's invaluable.

What about other pages, such as, say the Admin Center, which are Forum Name > Administration Center, or Who's Online, or... pretty much any other page in the forum.

Vveb.ws

#6
Quote from: Arantor on November 13, 2009, 11:05:31 AM
Category Name isn't actually an unnecessary link, though it can be undesirable - apart from telling users where the post is, it actually links to the category itself - try it on this site, you'll see it'll take you to the part of the front page where the category is; on larger forums it's invaluable.
You're wrong!
It is hard to loose the nessesary forum on the index page. The site has been made not for idiots

Quote from: Arantor on November 13, 2009, 11:05:31 AM
What about other pages, such as, say the Admin Center, which are Forum Name > Administration Center, or Who's Online, or... pretty much any other page in the forum.
I do not understand to what you are saying this


I'm talking about the linktree (path) to the page. The first two links - clearly unnecessary

Even if you're really not want to delete the first two links, they should be called like this:
Home>
Forum "Forum name" >
Subforum "Subforum name"  >
Topic "Topic name" >


By analogy, as on the main page written under forums "Subforums:"

Arantor

Quote from: Vveb.ws on November 13, 2009, 11:42:03 AM
You're wrong!
It is hard to loose the nessesary forum on the index page. The site has been made not for idiots

Depends how big your front page is. On this forum we have well over a hundred boards in multiple categories.

QuoteI do not understand to what you are saying this

I'm talking about the path to the options page. The first two links - clearly unnecessary

The same code that runs the linktree is used throughout SMF, every single page uses the same code.

The linktree for this page is:
Simple Machines Community Forum » SMF Development » Feature Requests » Topic: Remove linktree from front page

For the front page it's simply:
Simple Machines Community Forum

For Who's Online, it's:
Simple Machines Community Forum » Who's Online

For the calendar, it's:
Simple Machines Community Forum » Calendar » November 2009


My question, then, is do you want to remove the first two items across the entirety of the forum or just in boards and threads, and globally remove the first item?

Vveb.ws

#8
Well, you are something right !
The replacement will be most little.

I want view so:
MainPage » Category: SMF Development » Forum: Feature Requests » Topic: Remove linktree from front page

"Simple Machines Community Forum" - replace with "MainPage" or delete.
!! The first tab in the menu - also link to HomePage. I thought so, it is better to remove the tab than a link to a HomePage in LinkTree.
I decide, The Category don't delete, add word "Category" at the beginning


and if it possible to wirte so, it will be beatefull:
MainPage » Category: SMF Development » Forum: Feature Requests» Subforum: Helps » Topic: Remove linktree from front page

I have this strukture
forum
|_subforum

only
no more included |_subforums


Arantor

Would 'Category: ' be added to every entry across the site, e.g. Website > Category: Who's Online, or Website > Category: Calendar ?

Vveb.ws

#10
Quote from: Arantor on November 13, 2009, 12:17:00 PM
Would 'Category: ' be added to every entry across the site, e.g. Website > Category: Who's Online, or Website > Category: Calendar ?
yes, of course

in fact, I do not care.

I turned off calendar

from this one page
/index.php?action=who
we don't shall thinking and doing something other (laziness  ;) ), shall we ?


Arantor

Please can you attach your theme's index.template.php for me to make the modifications on then?

Vveb.ws

#12
I have something remake in \Themes\default\index.template.php: header top.htm and footer counter.htm (in this two files there is only one word for saple, nothing important)
I have turned off some scripts :)
simplified table (user, date, etc) in top

this version of \Themes\default\index.template.php works normal on my site  ozdorovlenie.vveb.ws

Translate Promt or Google(better translate)

Arantor

To edit the linktree:

Code (find in index.template.php) Select
function theme_linktree()
{
global $context, $settings, $options;

echo '<div class="nav" style="font-size: smaller; margin-bottom: 2ex; margin-top: 2ex;">';

// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// 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 '<b>', $settings['linktree_link'] && isset($tree['url']) ? '<a href="' . $tree['url'] . '" class="nav">' . $tree['name'] . '</a>' : $tree['name'], '</b>';

// 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 '&nbsp;>&nbsp;';
}

echo '</div>';
}


It should be changed to:
Code (replace) Select
function theme_linktree()
{
global $context, $settings, $options;

echo '<div class="nav" style="font-size: smaller; margin-bottom: 2ex; margin-top: 2ex;">';

$context['linktree'][0]['name'] = 'MainPage';
$context['linktree'][1]['extra_before'] = 'Category: ';

// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// 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 '<b>', $settings['linktree_link'] && isset($tree['url']) ? '<a href="' . $tree['url'] . '" class="nav">' . $tree['name'] . '</a>' : $tree['name'], '</b>';

// 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 '&nbsp;&gt;&nbsp;';
}

echo '</div>';
}



If you want to remove the Home button, find and remove this:

// Show the [home] button.
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '">' , $txt[103] , '</a>
</td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

Vveb.ws

#14
A trifle, one word, as pleasure!
I Did, it working.
Thank you!


How I can insert SIMPLE link in menu index.template.php
SMF has special tab for curent page. It is too difficult to addd new punkt of menu.

I can do menu with selected tab or buttons in 2 ways:
1) script "onmouseover" - sample blacksotnya.com
2) with css - sample vveb.ws bottom of page
a.ar:visited {  background-image: url(off.png);  }
a.ar:link {  background-image: url(off.png);  }
a.ar:hover {  background-image: url(on.png);  }


But do menu, so you doing for SMF, I can not !
As for me, something you much too clever with the menu ("crufty software"). It need be doing more simple
It need to do simple PNG buttons or other background for links if mouse-over.

Outside (for users and admin) SMF forum looks much easier (and agreeable)

Variants:
1) select other theme ? - no! I have too more replacement in \Themes\default\index.template.php that change it
2) delete all this difficult menu and write my own - problem ! this menu content "Registration", "Logout", "Login" which chooses  when user logining.

As for sample, in phpBB I can'nt understand how add forums and write permissions for goup of users. Generally I don't understand phpBB  :'( . But in SMF all outside very popular  :) thanks !

Arantor

Well, all the menu stuff changed in 2.0 so it doesn't come from index.template.php any more. Part of why this code is complicated is because it also has support for IE 4 in it.

If you want a simple link to another page in there... just add this code in the right place (I can't tell you the right place without knowing where you want the button):


echo '
<td valign="top" class="maintab_back">
<a href="http://my.website.com/">What Text The User Sees</a>
</td>';

Vveb.ws

#16
Thank you!
it's works, of course
I now become ridiculous!  ;D
Until such a simple solution I must to guess himself.
Sorry  :-[

L'AltroWeb

Quote from: Arantor on November 13, 2009, 05:28:45 PM
To edit the linktree:

Code (find in index.template.php) Select
function theme_linktree()
....
$context['linktree'][0]['name'] = 'MainPage';
...

Thanks, it work but i've test also to make this:
$context['linktree'][0]['url'] = 'http:/mysite.org'; //to remove index.php
but dont work.
can u plese help me to fix?

Arantor

So what does it do then if you use that?

L'AltroWeb

#19
Quote from: Arantor on December 04, 2009, 08:37:43 PM
So what does it do then if you use that?
home link still remain with index.php and all other link will be changed and damaged :|
-
Anyway i've fixed with a little mod in Load.php ;)
-
Code (Search:) Select
// Set the top level linktree up.
array_unshift($context['linktree'], array(
'url' => &$scripturl,
'name' => &$context['forum_name']
));


Code (Replace) Select
// Set the top level linktree up.
$fixurl = 'http://www.darkwolf.it/';
$fixname = 'Home';
array_unshift($context['linktree'], array(
'url' => &$fixurl,
'name' => &$fixname
));

Advertisement: