Adding A New Top Menu Button

If you want a "Misc" menu with dropdowns to your top menu, it's not hard to do.This tutorial assumes that you have a BLANK customconfig.php page. If your page is not blank, you will need to transfer your items to the new customconfig.php page that we are going to code. You will also need a program to edit it. You can use Notepad, Notepad++, Dreamweaver, Expression Web 4 (this is a discontinued program from Microsoft, but it will work for editing pages - You can download it from my site for free if you wish to use it. It is also an "executable" file, so your virus protection service may warn you about downloading it.)

1. Find your "customconfig.php" page and make a copy. Save your copy in a place that you can easily retrieve it, should something go wrong.
2. Download the new "customconfig.zip" file here, unzip it and open it to edit.
3. When you open the file, you will see this:

<?php
//your custom PHP code goes here.
//these are "comment" lines and will be ignored
//here's how to set a custom variable:
//$somevalue = "thevalue";

session_start();
if( $_SESSION['templatepath'] )
$templatepath = $_SESSION['templatepath'];
if( $_SESSION['templatenumber'] )
$templatenumber = $_SESSION['templatenumber'];
if( $_SESSION['templateidx'] )
$templateidx = $_SESSION['templateidx'];

if(strpos($_SERVER['REQUEST_URI'],"admin") !== false) {
$demoreturn = "admin";
$_SESSION['demoreturn'] = "admin";
}
elseif(strpos($_SERVER['REQUEST_URI'],"ajx_") === false && strpos($_SERVER['REQUEST_URI'],"tngrss") === false && strpos($_SERVER['SCRIPT_NAME'],"ajx_") === false && strpos($_SERVER['SCRIPT_NAME'],"tngrss") === false) {
$demoreturn = "https://" . $_SERVER['HTTP_HOST'];
$demoreturn .= $_SERVER['REQUEST_URI'] ? $_SERVER['REQUEST_URI'] : $_SERVER['SCRIPT_NAME'] . "?" . $_SERVER['QUERY_STRING'];
$_SESSION['demoreturn'] = $demoreturn;
}

$custmenu['title_text'] = 'Misc';

// Custom Menu links
$link_nr=0; // the first link in the menu is always number 0

$custommenulinks[$link_nr]['target'] = "misc/index.php";
$custommenulinks[$link_nr]['label_text'] = "Misc Pages";

$link_nr++; // increment the number for each additional link (1)
$custommenulinks[$link_nr]['target'] = "misc/faq.php";
$custommenulinks[$link_nr]['label_text'] = "FAQs";

$link_nr++; // increment the number for each additional link (1)
$custommenulinks[$link_nr]['target'] = "misc/diseases.php";
$custommenulinks[$link_nr]['label_text'] = "Diseases";

$link_nr++; // increment the number for each additional link (1)
$custommenulinks[$link_nr]['target'] = "misc/military.php";
$custommenulinks[$link_nr]['label_text'] = "Soldiers";

$link_nr++; // increment the number for each additional link (1)
$custommenulinks[$link_nr]['target'] = "misc/legalterms.php";
$custommenulinks[$link_nr]['label_text'] = "Legal Terms";

$link_nr++; // increment the number for each additional link (1)
$custommenulinks[$link_nr]['target'] = "misc/about.php";
$custommenulinks[$link_nr]['label_text'] = "About Us";

$link_nr++; // increment the number for each additional link (1)
$custommenulinks[$link_nr]['target'] = "histories/home.php";
$custommenulinks[$link_nr]['label_text'] = "Histories";
// end of Custom Menu
?>

Explanation of coding for the menu:

Please understand that MY miscellaneous pages are in a separate folder called "misc". Yours may be in your "histories" folder or another folder of your choice.

$custmenu['title_text'] = 'Misc';   This is the name of the top link. This name is coded into TNG and is not easily changed.

The code below is for the sublinks. They will be shown in the order you place them.
This the code code for the first sublink. This line will be the first sublink since it is first in line.

$custommenulinks[$link_nr]['target'] = "misc/index.php";   This tells the name of the folder and the page I wish to link to.
$custommenulinks[$link_nr]['label_text'] = "Misc Pages";   This is the text, "Misc Pages" that is shown on the first sublink

This line will be the second sublink since it is second in line.

$link_nr++; // increment the number for each additional link (1)
$custommenulinks[$link_nr]['target'] = "misc/faq.php";   This tells the name of the folder and the page I wish to link to.
$custommenulinks[$link_nr]['label_text'] = "FAQs";        This is the text, "FAQ's" that is shown on the second sublink.

This line will be the third sublink since it is third in line.

$link_nr++; // increment the number for each additional link (1)
$custommenulinks[$link_nr]['target'] = "misc/diseases.php";   This tells the name of the folder and the page I wish to link to.
$custommenulinks[$link_nr]['label_text'] = "Diseases";           This is the text, "Diseases" that is shown on the third sublink.

4. Edit your page as you want it. Be careful NOT to delete any quotation marks, semicolons, carots (<>) or any other symbols. The page will not work and may cause your site not to work. If for some reason your site does not work, upload your original file and then check the customconfig.php file that you are editing.
5. If your New pages have not yet been created and/or uploaded, do that now.
6. Upload the new customconfig.php (NOT THE ZIP FILE) into your root folder of TNG. If you have created other pages, upload them into the folder you assigned them. Make sure the links work.

You can see my "Misc Pages" in the "See in Action" section of my TNG Templates.

 

Buy with Confidence

we accept Visa, MasterCard and PayPal

You can use any major credit card
through PayPal at checkout.

Thanks,
Marsha

Contact Us

Monday-Friday: 9am - 6pm
Saturday: 10am - 5pm
Sunday: Noon - 5pm
Eastern Time Zone