Jump to content
TNG Community

Additional Dropdown menu / genlib mod


LR Majercin

Recommended Posts

thewillistree

NOTE: This top post was reedited on 21 Mar 2007. It corrects original errors, and all the discussion that follows this top post in this thread. Larry

I added an additional dropdown menu (using template 2), TNG version 6.0.4.

Additional support was greatfully contributed by Ken Roy and Roger Moffat.

In order to create an additional dropdown menu, you will need to make changes to the genlib.php file and create additional text in the English/cust_text.php file.

You may also choose to create new custom icons. These .gif files will need to reside on your main genealogy folder.

Please make a backup of these files before making any changes.

The lines referenced refer to an unaltered genlib file. Your lines may vary if you have made previous changes. Lines will be referenced in greatest to least fashion to keep the line numbers as true as possible.

Red text references code links to the English/cust_text.php file. Add your own custom text. These codes will put the text on your new links.

Blue text references URL links. Change these to your URL links.

Green text references icon links. Either reference existing TNG icons, or create your own (20x20 pixels). Feel free to copy mine at http://www.majercin.com/surnames.php .

In genlib.php:

1. After (about line 496):

border=\"0\" hspace=\"4\" style=\"vertical-align:middle\" align=\"left\" alt=\"\" />$text[contactus]</a></li>\n";
   $menu .= "</ul>\n";
   $menu .= "</li>\n";
and before the trailing "}" add the following (make sure to change the colored text): $menu .= "<li><a href=\"#\"><img src=\"$cms[tngpath]" . "ArrowDown.gif\" width=\"25\" height=\"8\" vspace=\"4\" border=\"0\" align=\"left\" alt=\"\" />$text[mgr_extras]</a>\n"; $menu .= "<ul id=\"fourth\">\n"; $menu .= "<li><a href=\"/phpbb/viewforum.php?f=1\"><img src=\"$cms[tngpath]mgr_faq.gif\" width=\"20\" height=\"20\" border=\"0\" hspace=\"4\" style=\"vertical-align:middle\" align=\"left\" alt=\"\" />$text[mgr_faq]</a></li>\n"; $menu .= "<li><a href=\"/phpbb/index.php\"><img src=\"$cms[tngpath]mgr_forum.gif\" width=\"20\" height=\"20\" border=\"0\" hspace=\"4\" style=\"vertical-align:middle\" align=\"left\" alt=\"\" />$text[mgr_forum]</a></li>\n"; $menu .= "<li><a href=\"/cpg144/index.php\"><img src=\"$cms[tngpath]mgr_famphoto.gif\" width=\"20\" height=\"20\" border=\"0\" hspace=\"4\" style=\"vertical-align:middle\" align=\"left\" alt=\"\" />$text[mgr_famphoto]</a></li>\n"; $menu .= "<li><a href=\"Obits.html\"><img src=\"$cms[tngpath]tng_hs.gif\" width=\"20\" height=\"20\" border=\"0\" hspace=\"4\" style=\"vertical-align:middle\" align=\"left\" alt=\"\" />$text[mgr_obit]</a></li>\n"; $menu .= "<li><a href=\"databases.html\"><img src=\"$cms[tngpath]tng_admin.gif\" width=\"20\" height=\"20\" border=\"0\" hspace=\"4\" style=\"vertical-align:middle\" align=\"left\" alt=\"\" />$text[mgr_data]</a></li>\n"; $menu .= "<li><a href=\"fam_links.html\"><img src=\"$cms[tngpath]tng_names.gif\" width=\"20\" height=\"20\" border=\"0\" hspace=\"4\" style=\"vertical-align:middle\" align=\"left\" alt=\"\" />$text[mgr_famlink]</a></li>\n"; $menu .= "<li><a href=\"spanlinks.html\"><img src=\"$cms[tngpath]mgr_span.gif\" width=\"20\" height=\"20\" border=\"0\" hspace=\"4\" style=\"vertical-align:middle\" align=\"left\" alt=\"\" />$text[mgr_span]</a></li>\n"; $menu .= "<li><a href=\"slavlinks.html\"><img src=\"$cms[tngpath]mgr_slav.gif\" width=\"20\" height=\"20\" border=\"0\" hspace=\"4\" style=\"vertical-align:middle\" align=\"left\" alt=\"\" />$text[mgr_slav]</a></li>\n"; $menu .= "</ul>\n"; $menu .= "</li>\n"; 2. On line 442: Change:
$menu .= "<table$iconalign width=\"400\">\n";
to:
$menu .= "<table$iconalign width=\"410\">\n";
This allows the newly created menu to stay on the same line in Firefox and Safari browsers. 3. Change line 53 from:
echo "<style type=\"text/css\">#mnav li:hover #third, #mnav li.sfhover #third {left: 130px;}</style>\n";
to:
echo "<style type=\"text/css\">#mnav li:hover #fourth, #mnav li.sfhover #fourth {left: 228px;}</style>\n";
This creates the shift for the dropdown menus. The increase in pixels allows the dropdowns to align in IE 7. There is still a bit of an offset in Firefox. Depending on your preference you can increase this to about 236px if you want it to align in Firefox or Safari. Save and close genlib.php
IN English\cust_text.php: Create your own custom text specific to your new links. Here's mine:
$text[mgr_extras] = "Extras";
$text[mgr_faq] = "F.A.Q.";
$text[mgr_forum] = "Forum";
$text[mgr_famphoto] = "Family Photos";
$text[mgr_obit] = "Obituaries";
$text[mgr_slav] = "Slavic Links";
$text[mgr_span] = "Spanish Links";
$text[mgr_data] = "Databases";

Here's a link to an example:

http://www.majercin.com/surnames.php

Hope this can be of use to some of you.

Regards,

Larry

Thanks for this - its a big help! However, is the code different if I'm pointing to an external html site? I want to include a link to my Blog, do I code this link in the same way?

Paul

Link to comment
Share on other sites

Thanks for this - its a big help! However, is the code different if I'm pointing to an external html site? I want to include a link to my Blog, do I code this link in the same way?

Paul

Paul,

You would need to code external links with the complete path. If I followed the link correctly to your blog, the entry for your blog external link would be

$menu .= "<li><a href=\"http://thewillistree.blogspot.com/\"><img src=\"$cms[tngpath]my_blog.gif\" width=\"20\" height=\"20\" border=\"0\" hspace=\"4\" style=\"vertical-align:middle\" align=\"left\" alt=\"\" />$text[my_blog]</a></li>\n";
where you would create your own gif for your blog which I called my_blog.gif above and the $text[my_blog] in your cust_text.php. To simplify things, I created a sitemenu.php that contains the menu entries I want to add for the Site pull down on my site, and then only have to add a one line mod to genlib.php
        @include ("user/sitemenu.php"); // 4th menu additions KCR
which is after line 464 in TNG 7.0. The line to add the div id for the 4th menu is a replacement of line 70 in TNG 7.0
            echo "<style type=\"text/css\">#mnav li:hover #fourth, #mnav li.sfhover #fourth {right: 40px;}</style>\n"; // change from #third to #fourth  when adding 4th menu pull down and from right: 0px to 40px to allow language pull down to be visible in FireFox by KCR

Hope that helps.

Link to comment
Share on other sites

  • 2 weeks later...

Ken Roy,

I had not updated my page by the time you wrote your reply.

Take a look at this link: http://www.majercin.com/surnames.php . I've checked it in IE 7.0.5730, IE 6.2 and Firefox 2.0.0.3. These are the only browsers I have to reference. I'll still need to see it in Safari, tomorrow.

Thanks, Larry

I've been trying to put the menu into my home page, and the dropdowns work in Firefox 3.0, but not well in IE 6.0. In that browser the dropdowns are misaligned quite a bit, though they do show up. Here's the link http://www.kmtrees.com/genealogy/index.php .

Any ideas what is wrong?

Link to comment
Share on other sites

I've been trying to put the menu into my home page, and the dropdowns work in Firefox 3.0, but not well in IE 6.0. In that browser the dropdowns are misaligned quite a bit, though they do show up. Here's the link http://www.kmtrees.com/genealogy/index.php .

Any ideas what is wrong?

On the index.php you may need to issue the request for the menu in the place where you want to show the pull down menu rather than letting the tng_header function generate it by using

$flags['noicons'] = true;
before the tng_header function is invoked. To generate the pull down menu you would add
    echo tng_icons($instance);

in the code where you want the menu to be displayed.

Link to comment
Share on other sites

thewillistree

On the index.php you may need to issue the request for the menu in the place where you want to show the pull down menu rather than letting the tng_header function generate it by using

$flags['noicons'] = true;
before the tng_header function is invoked. To generate the pull down menu you would add
    echo tng_icons($instance);

in the code where you want the menu to be displayed.

Hi,

Can someone explain how to add the drop-down menus to my index.php page? I like the dhtml menu I have at the moment, but its very script-heavy and I have to create a new version each time I amend the TNG version.

Paul

Link to comment
Share on other sites

Hi,

Can someone explain how to add the drop-down menus to my index.php page? I like the dhtml menu I have at the moment, but its very script-heavy and I have to create a new version each time I amend the TNG version.

Paul

Paul,

The instructions above should work for adding the pull down menu to your index page, probably in the same location where you currently added the dhtml menu code.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...