Site Menu Mod

From TNG_Wiki
Jump to: navigation, search
Obsolete The Site Menu Mod is obsolete with TNG V10.

The Custom Menu Hook introduced in TNG V9 has been redesigned to use the syntax of the Custom Drop Down Menu mod which is also obsolete with TNG V10.

TNG version: 9.2.2
TNG version: 6.0

See Custom Menu Hook Mod for a replacement mod for TNG V10 and Converting Custom Menu Hook for how to convert your existing Site Menu Mod to the new Custom Menu Hook syntax.
TNG V10 action required

Site Menu Mod
Summary This is an example mod that adds a 4th pull down menu
Validation This mod is XHTML compliant.Valid-xhtml10.png
Mod Updated {{{mod_last_update}}}
Download link for
TNG 9.0]
TNG 8.1
TNG 8.0
TNG 7.0
Download stats View Site Menu download stats
Author(s) Larry Majercin with help from Roger Moffat and Ken Roy
who converted the mod to use an include for the sitemenu.php
Homepage Site Menu Mod
Mod Support TNG Community Forums
Contact Developer
Latest Mod for TNG V9
8.1.1 for TNG V8.1 only
8.1.0a for TNG V8.0.0 - 8.0.2 only
1.0 for TNG V7
Min TNG V 7.0.0
Max TNG V 9.2.2
Files modified
css/mytngstyle.css (TNG V8 only)
extensions/sitemenu.php added
customconfig.php for TNG V9 and after
Related Mods
This mod is an example only, see Pre-install Edits for changes you need to make to create your own Site Menu Mod

Purpose of the mod

This mod was developed to make it easier to add site specific menu entries to the TNG pull down menu by adding a 4th pull down menu as a Site menu as discussed in the following Additional Dropdown menu / genlib mod on the TNG Community Forum

Note that this mod is a sample mod only. You must create your own Site menu entries using this mod.

A manual install of this mod is possible in TNG V6 as shown in the TNG Community Forum entry

TNG version: 9.0
TNG V9 added a Custom Menu Hook to make it easier to add a custom menu. This mod was reworked to take advantage of this new capability. If you want to add a Site menu, but don't want to use the Mod Manager then you can manually code your custom pull down menu by adding the information in your customconfig.php file. See How to add it manually in the Custom Menu Hook page.

See Custom Drop Down Menu as an alternative to using this mod.


Ken Roy developed the sitemenu mod as a single line conditional include based on information originally provided by Larry Majercin with help from Roger Moffat in the TNG Community Forum entry

TNG version: 9.0
For TNG V9, this mod was reworked to use the new Custom Menu Hook


This mod has the following advantages:

  • adds a 4th pull down menu without having to add menu entries in the genlib.php code directly
  • places the added code in the extensions subdirectory, which allows for removing the code by renaming the sitemenu.php script

Automated Install

  1. Download the appropriate zip file of the example site menu config file from the summary in the upper right hand corder
  2. After downloading the config file, unzip it into the admin/mod_folder for TNG V7 or mods for TNG V8 and above
  3. Edit it with an ASCII text editor like Notepad-plus-plus, PSPad, or TextWrangler and save it as site_menu_v8.1.0.cfg for TNG V8 or site_menu_v9.0.0.0.cfg for TNG V9 tailored for your site
  4. then follow the normal automated installation for Mod Manager mods.

Pre-install Edits

TNG version: 8.1.3
TNG version: 7.0
Note that the site_menu_example.cfg only includes an example of the sitemenu.php that gets created in the extensions subdirectory. You need to edit that portion of the config file to add your own menu entries.

TNG version: 8.0
Note that in TNG V8 and above the variables are within single quotes, so the syntax has changed:
  • so $cms[tngpath] became $cms['tngpath']
  • and now needs to be enclosed within braces when concatenated in front of the location of the script or image, such as
	$menu .= "<li><a href=\"{$cms['tngpath']}user/research_resources.php\"><img src=\"
{$cms['tngpath']}user/images/my_resources.gif\" class=\"tnggif\" align=\"left\" alt=\"\"

(note that line feeds were inserted to wrap the text for display in the line above)

Note also that only the English custom text is included. If you use other languages, you will need to add them to the config file.

In TNG V8:

  • the custom text was added to both the languages/English/cust_text.php and languages/English-UTF8/cust_text.php files. You can delete the one you are not using
  • the style definition for #mnav li:hover #third, #mnav li.sfhover #third in css/genstyle.css was also commented out so the 3rd pull down would behave like the 1st and 2nd
  • the style definition for the 4th pull down was set to right: 0px;, which you can change to 40px; if you want to offset the menu to see the language pull down behind it.

TNG version: 9.0
The Site Menu Mod now uses the Custom Menu Hook and is installed in the customconfig.php file

Revision History

Version Date Description
v9.0.0.0 1 Februayr 2012 updated for TNG V9.0.0 to use the Custom Menu Hook and now put the Site menu in the customconfig.php file
v8.1.1 2 January 2011 updated for TNG V8.1
V8.1.0a 28 December 2010 This version eliminates the conflict with the Change Language Droplist mod and was provided by Jeff Robison
V8.1.0 21 May 2010 Updated for TNG V8
V1.0 4 June 2009 Original Mod Manager version of the sample mod

Custom Text

The following text example is provided for the languages/English/cust_text.php and languages/English-UTF8/cust_text.php files

$text['site'] = "Site";
$text['myresearch'] = "Research Resources";
$text['mnuguestbook'] = "Sign our Guestbook";

Visualization of Mod

Menu Example
TNG version: 8.1.3
TNG V9 example Site Menu
TNG version: 9.0

Sites using this mod

  • Please add TNG site that you have found that utilize this modification
URL User Note Mod-Version TNG-Version User-language
Our Roy and Boucher Family Ken Roy I use this TNG mod for my Census, Military Service Ribbons, Historical Maps, and Photos media types. 9.0.3 EN, FR
Ennever family history Barry Ennever I also use this TNG mod and have extended it to create all 4 of the dropdown menus.