Site Menu Mod
From TNG Wiki
| Site Menu Mod | |
|---|---|
| Summary | This is an example mod that adds a 4th pull down menu |
| Download link | site_menu_example_v8.1.0.zip for TNG V8 site_menu_v1.0_example.zip for TNG V7 |
| 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 Forums |
| Latest Mod | 8.1.0 for TNG V8 only 1.0 for TNG V7 |
| Min TNG V | 7.0.0 |
| Max TNG V | 8.0.0 |
| Files modified | genlib.php css/mytngstyle.css (TNG V8 only) languages/English/cust_text.php languages/English-UTF8/cust_text.php extensions/sitemenu.php added |
| Related Mods | |
| Notes | 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 TNG Forum entry
Developer
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 Forum entry
Advantages
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 or not creating the extensions subdirectory.
Automated Install
- An installed current version of the Mod Manager.
- Download the appropriate zip file of the example site menu config file from the summary in the upper right hand corder
- After downloading the site_menu_example.zip config file, unzip it into the admin/mod_folder for TNG V7 or mods for TNG V8
- Edit it with an ASCII text editor like Notepad-plus-plus, PSPad, or TextWrangler and save it as site_menu_v1.0.cfg for TNG V8 or site_menu_v8.1.0.cfg for TNG V8 tailored for your site
- then follow the normal automated installation for Mod Manager mods.
Pre-install Edits
Note that the site_menu_v1.0_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.
Note that in TNG V8 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=\"\"
/>{$text['myresearch']}</a></li>\n";
(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.
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";
TNG User sites using this mod
- Please add TNG site that you have found that utilize this modification
Site List
| *Our Acadian, French Canadian, and Maine Ancestors I use this TNG mod to create my site menu for pages that are not part of TNG. (Ken Roy) |
| *Ennever family history I also use this TNG mod and have extended it to create all 4 of the dropdown menus. (Barry Ennever) |
