[SMF 2.0b3.1] Help center's linktree is missing

Started by Deprecated, August 18, 2008, 06:42:09 PM

Previous topic - Next topic

Deprecated

The behavior of the Help center does not match most of SMF's other tabs in that its linktree is missing. Most of SMF's other pages do have linktrees (e.g. the default theme).

I can find no related reports in the bug tracker. I've developed a fix that adds the missing linktree and gives it a logical behavior.

In Help.php find this code:    // We actually need a special style sheet for help ;

Add this code before it:    global $scripturl;
    $context['linktree'][] = array(
        'url' => $scripturl.'?action=help',
        'name' => $txt['manual_profile_help'],
        );
    $context['linktree'][] = array(
        'url' => $scripturl.'?action=help;page=' . $context['current_page'],
        'name' => $txt['manual_index_' . $context['all_pages'][$context['current_page']]],
        );


Then find this code in Help.template.phpfunction template_manual_above()
{
    global $context, $settings, $options, $txt, $scripturl;


Add this code after it:    echo theme_linktree();


That creates linktree displays in the following form:

{forum name} > Help > Introduction
{forum name} > Help > Registering
{forum name}> Help > Logging In
...


I think some additional thought should be given to how the linktree operates over all the possible pages. For example the admin center, mod center and profile center do not have linktrees. The Messages center however does have a linktree. It's illogical that some "center" type pages should have linktrees andothers  do not. IMO they should be all the same way, and I think it would look better to include the linktree on every page. That would give a consistent appearance throughout all SMF's pages.

I've made a mod package to install the linktree fix and I've attached it to this post if anybody wants to see how it works. I've also uploaded it to the mod site and that will be available when/if the Customization Teams approves.

SleePy

Interesting I never noticed that  :P

I asked the developers if this was intentionally done like this or not.
Although 2 tings.


  • Rules.template.php doesn't exist
  • You should make sure the text string exists if its going to be dynamic like that. Just for safe keeping if a mod adds a new help section for some reason
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Deprecated

And I got 2 tings wid you. ;)

I used the wrong word, got confused with a mod I'm workin wid. I meant "Help.template.php" and I have corrected my OP. The attached mod package is correct.

And if a mod adds a new help section, it's the mod's author's responsibility to ensure that his mod adds an appropriate text string. If not it will probably throw errors and the Customization Team will be on his case like fleas on a hound dog!

So you asked the developers if this was intentional or not. WTF did they say? :D


SleePy

Well even if the mod adds it, it is possible that another language might not have that string for the mod.

I have not heard back from our busy developers yet :P
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Deprecated

Quote from: SleePy on August 19, 2008, 12:36:15 PM
Well even if the mod adds it, it is possible that another language might not have that string for the mod.

The mod doesn't add any new $txt[] strings. It merely uses the same $txt[] strings that are already being used in other parts of Help.php. For this reason there is no need to test to see if the strings exist. The other parts of the code don't test it either.

Deprecated


SleePy

Deprecated,

The developers have said that it wasn't intended for the Help section to have a link tree. Even more the heading there does have links for which section you are in.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Deprecated

Sleepy,

Tell the developers that I intended for the Help section to have a link tree. Even more the heading there does not have the links for the section you are in.

Potato. Potatoe.

Advertisement: