Custom Top Menu

Started by smp420, May 15, 2010, 12:57:45 PM

Previous topic - Next topic

Liam.

Quote from: Afro on May 16, 2010, 06:19:42 PM
CG4 is actually right. Adding a "how to' will save you a lot of work unless you are ready to answer a lot of questions.
So i would add HOW TO if i were you.
A lot of inexperienced users troop in here daily and some of them cant locate a source or template file.
So make things easier for everyone by adding a HOW TO if you can.

Which is why the tutorial is linked to - which explains everything in detail...

smp420

As Liam said the how to was already linked in this topic.
"Things turn out best for those who make the best of the way things turn out." -Jack Buck

Afro

We are talking about linking the "how to " in the first post.
I believe you dont expect people to continue reading all posts until they find the link.

Bugo

Very useful mod :)

Russian translation

smp420

Thanks for the translations I added them and uploaded version 1.2, the only change in version 1.2 is the Russian translation. If anyone else has any translations please post them.
"Things turn out best for those who make the best of the way things turn out." -Jack Buck

kaib0rg

really sweet mod.  is this only working on the default theme though?  i installed it and it's not showing up on pixelwood. :-/

Liam.

Quote from: kaib0rg on May 19, 2010, 03:14:17 PM
really sweet mod.  is this only working on the default theme though?  i installed it and it's not showing up on pixelwood. :-/

That sums it all up. This is only actually for Curve and Curve Variations, and probably won't work with any other themes...

kaib0rg


ScopeXL

If your looking for simple use of this feature (one-level links) then this mod is great. If however your site requires a dropdown (2-3 level) or additional links, then refer to my tutorial in Tips/Tricks board (link below). It's an exact step by step of how to accomplish this manually. I'm always available to offer help with this tip.

@smp420: great job implementing this into a mod. I suggest looking at my tutorials CSS edits to make it so the menu links don't wrap onto another line if the users browser resolution is smaller than suggested. Otherwise nicely done.

Here's the link to the tutorial for those needing the dropdown effect and/or additional links (this is a manual edit, not a mod)
http://www.simplemachines.org/community/index.php?topic=360100.0

Bruno36

Hello!

I add 5 new link.
The problem you are invisible in the menu
Bruno36 the French
SMF 2.0.9

Liam.

Quote from: Bruno36 on May 20, 2010, 04:19:58 AM
Hello!

I add 5 new link.
The problem you are invisible in the menu

What exactly did you add to the mod? You'd have to add and match the code in index.template.php and ManageSettings.php...

Bruno36

ManageSettings.php [/ b]

/ / La section du haut du menu admin.
Fonction ModifyCustomTopMenu ($ return_config = false)
(
txt global $, $ context ScriptUrl, $, les parametres $, SC, modSettings $;

/ / Récupère Toutes les zones de texte.
config_vars tableau $ = (
array ('texte', 'tab_url1 »),
array ('texte', 'tab_title1 »),
array ('texte', 'tab_url2 »),
array ('texte', 'tab_title2 »),
array ('texte', 'tab_url3 »),
array ('texte', 'tab_title3 »),
array ('texte', 'tab_url4 »),
array ('texte', 'tab_title4 »),
array ('texte', 'tab_url5 »),
array ('texte', 'tab_title5 »),
array ('texte', 'tab_url6 »),
array ('texte', 'tab_title6 »),
array ('texte', 'tab_url7 »),
array ('texte', 'tab_title7 »),
array ('texte', 'tab_url8 »),
array ('texte', 'tab_title8 »),
array ('texte', 'tab_url9 »),
array ('texte', 'tab_title9 »),
array ('texte', 'tab_url10 »),
array ('texte', 'tab_title10 »),
);
if ($ return_config)
config_vars return $;

Contexte post_url $ ['] = $ ScriptUrl. ? Action = admin; zone modsettings =; SA = Sauver custom_menu;
] Settings_title Contexte [$ '= $ txt custom_menu_title ['];

/ / Etes-vous économiseur?
if (isset ($ _GET ['save']))
(
checkSession ();

saveDBSettings (config_vars $);

redirectexit ("action = admin; zone modsettings =; SA = custom_menu ');

)

prepareDBSettingContext (config_vars $);

)


Modifications.english-utf8.php

//Custom Menu Strings Start Here
$txt['custom_menu_title'] = 'Top Menu';
$txt['tab_url1'] = '1st tab url';
$txt['tab_title1'] = '1st tab name';
$txt['tab_url2'] = '2nd tab url';
$txt['tab_title2'] = '2nd tab name';
$txt['tab_url3'] = '3rd tab url';
$txt['tab_title3'] = '3rd tab name';
$txt['tab_url4'] = '4th tab url';
$txt['tab_title4'] = '4th tab name';
$txt['tab_url5'] = '5th tab url';
$txt['tab_title5'] = '5th tab name';
$txt['tab_url6'] = '6st tab url';
$txt['tab_title6'] = '6st tab name';
$txt['tab_url7'] = '7nd tab url';
$txt['tab_title7'] = '7nd tab name';
$txt['tab_url8'] = '8rd tab url';
$txt['tab_title8'] = '8rd tab name';
$txt['tab_url9'] = '9th tab url';
$txt['tab_title9'] = '9th tab name';
$txt['tab_url10'] = '10th tab url';
$txt['tab_title10'] = '10th tab name';
//Custom Menu Strings End Here
Bruno36 the French
SMF 2.0.9

smp420

If you want 10 tabs to show find this line in index.template.php
   for ($i=1; $i<6; $i++)

Change to
   for ($i=1; $i<11; $i++)
"Things turn out best for those who make the best of the way things turn out." -Jack Buck

Bruno36

Thank you very much it works  :D
Bruno36 the French
SMF 2.0.9

Bugo

Quote from: smp420 on May 20, 2010, 05:29:34 PM
If you want 10 tabs to show find this line in index.template.php
   for ($i=1; $i<6; $i++)

Change to
   for ($i=1; $i<11; $i++)
Maybe add the ability to create unlimited number ($n) of buttons in a future version? :)

Afro


smp420

Quote from: Bugo on May 21, 2010, 03:31:20 AM
Quote from: smp420 on May 20, 2010, 05:29:34 PM
If you want 10 tabs to show find this line in index.template.php
   for ($i=1; $i<6; $i++)

Change to
   for ($i=1; $i<11; $i++)
Maybe add the ability to create unlimited number ($n) of buttons in a future version? :)
Well as the mod isn't meant to have unlimited tabs I highly doubt that will happen.
"Things turn out best for those who make the best of the way things turn out." -Jack Buck

frenki

I am gettin error in admin.php file during installation on RC2.0. Can you make it compatible with 2.0RC ?

// Mod Authors for a "ADD AFTER" on this line. Ensure you end your change with a comma. For example:
// 'shout' => array($txt['shout']),
// Note the comma!! The setting with automatically appear with the first mod to be added.


'custom_menu' => array($txt['custom_menu_title']),



Afro


smp420

If your talking about anything other than RC3 I will not make the mod compatible with an older version of SMF please update there has been many security and bug fixes in RC3.
"Things turn out best for those who make the best of the way things turn out." -Jack Buck

Advertisement: