<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.phpgedview.net/en/index.php?action=history&amp;feed=atom&amp;title=Build_a_New_Menu</id>
	<title>Build a New Menu - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.phpgedview.net/en/index.php?action=history&amp;feed=atom&amp;title=Build_a_New_Menu"/>
	<link rel="alternate" type="text/html" href="https://wiki.phpgedview.net/en/index.php?title=Build_a_New_Menu&amp;action=history"/>
	<updated>2026-04-30T00:24:19Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>https://wiki.phpgedview.net/en/index.php?title=Build_a_New_Menu&amp;diff=11254&amp;oldid=prev</id>
		<title>Elliott1961 at 14:11, 6 December 2008</title>
		<link rel="alternate" type="text/html" href="https://wiki.phpgedview.net/en/index.php?title=Build_a_New_Menu&amp;diff=11254&amp;oldid=prev"/>
		<updated>2008-12-06T14:11:01Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Genealogy is what is in your database; the names, facts, and events.  Of course, you can put stories in notes, but sometimes you wish to have separate pages where you can, for example, detail a family history, present images with commentary, or have a links page.  With this tutorial, you will learn how to modify PhpGedView to show a custom menu linking to custom pages with the standard PhpGedView header and footer.&lt;br /&gt;
&lt;br /&gt;
== Add a new Menu ==&lt;br /&gt;
&amp;lt;font color=red&amp;gt;Before you make any changes, please [[How_To:Customize_Themes|save]] the theme &amp;quot;Cloudy&amp;quot; and work only on a renamed copy of it.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will find the relevant PHP-code in the file &amp;quot;'''header.html'''&amp;quot;. &amp;lt;br&amp;gt;&lt;br /&gt;
Because every theme has its own menu-system, we will show you the essential changes as an example for the theme &amp;quot;'''Cloudy'''&amp;quot;. &amp;lt;br&amp;gt;&lt;br /&gt;
In my case, I have set the variable for User-may-change-Themes to &amp;quot;no&amp;quot; and Standard-Theme to &amp;quot;Cloudy&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
The &amp;quot;header.html&amp;quot; for &amp;quot;Cloudy&amp;quot; you will find in the following path: &lt;br /&gt;
&lt;br /&gt;
 /phpGedView/themes/cloudy/header.html&lt;br /&gt;
&lt;br /&gt;
Open the file with an html-editor or with a simple text-editor.&amp;lt;br&amp;gt;&lt;br /&gt;
Search for the first entry like:&lt;br /&gt;
&lt;br /&gt;
 $my_temp_menu= array();&lt;br /&gt;
 &lt;br /&gt;
The following lines build the first menu-point in PGV, shown in the PGV-page by the &amp;quot;Home&amp;quot;-icon.&amp;lt;br/&amp;gt;&lt;br /&gt;
All the stuff from this Home-menu (plus its submenus) is enclosed between &amp;quot;&amp;lt;nowiki&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;quot; and &amp;quot;&amp;lt;nowiki&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;quot; -tags. &amp;lt;br&amp;gt;&lt;br /&gt;
Every next &amp;quot;&amp;lt;nowiki&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/nowiki&amp;gt;...&amp;lt;nowiki&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;quot; -block encloses such a menu-icon with the concerning submenus.&amp;lt;br&amp;gt;&lt;br /&gt;
A dozen menu-items are enclosed in a &amp;quot;&amp;lt;nowiki&amp;gt;&amp;lt;table&amp;gt;&amp;lt;/nowiki&amp;gt;...&amp;lt;nowiki&amp;gt;&amp;lt;/table&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;quot; -tag.&amp;lt;br/&amp;gt;&lt;br /&gt;
The general '''menu-structure''' looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;lt;table&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
       &amp;lt;td&amp;gt;&lt;br /&gt;
          1. menu-item (with all submenu-items)&lt;br /&gt;
       &amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
       &amp;lt;td&amp;gt;&lt;br /&gt;
          2. menu-item (with all submenu-items)&lt;br /&gt;
       &amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
       &amp;lt;td&amp;gt;&lt;br /&gt;
          maybe your own new menu-item (with all submenu-items)&lt;br /&gt;
       &amp;lt;/td&amp;gt;&lt;br /&gt;
     &amp;lt;/tr&amp;gt;&lt;br /&gt;
     &amp;lt;tr&amp;gt;  &lt;br /&gt;
       &amp;lt;td&amp;gt;&lt;br /&gt;
          last menu-item (with all submenu-items)&lt;br /&gt;
       &amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code for the '''menu''' and the '''submenus''' looks like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!-- here starts a menu --&amp;gt;&lt;br /&gt;
     &amp;lt;td valign=&amp;quot;middle&amp;quot; width=&amp;quot;1&amp;quot; &amp;gt;&lt;br /&gt;
         &amp;lt;?php&lt;br /&gt;
             $menu = array();&lt;br /&gt;
             $menu[&amp;quot;label&amp;quot;] = &amp;quot;&amp;lt;font color=green&amp;gt;...............&amp;lt;/font&amp;gt;&amp;quot;;&lt;br /&gt;
             $menu[&amp;quot;labelpos&amp;quot;] = &amp;quot;none&amp;quot;;&lt;br /&gt;
             $menu[&amp;quot;icon&amp;quot;] = &amp;quot;&amp;lt;font color=green&amp;gt;...............&amp;lt;/font&amp;gt;&amp;quot;;&lt;br /&gt;
             $menu[&amp;quot;class&amp;quot;] = &amp;quot;menuitem&amp;quot;;&lt;br /&gt;
             $menu[&amp;quot;hoverclass&amp;quot;] = &amp;quot;menuitem_hover&amp;quot;;&lt;br /&gt;
             $menu[&amp;quot;flyout&amp;quot;] = &amp;quot;down&amp;quot;;&lt;br /&gt;
             $menu[&amp;quot;submenuclass&amp;quot;] = &amp;quot;submenu$ff&amp;quot;;&lt;br /&gt;
             $menu[&amp;quot;items&amp;quot;] = array();&lt;br /&gt;
 &lt;br /&gt;
             $submenu = array();&lt;br /&gt;
             $submenu[&amp;quot;label&amp;quot;] = &amp;quot;&amp;lt;font color=green&amp;gt;...............&amp;lt;/font&amp;gt;&amp;quot;;&lt;br /&gt;
             $submenu[&amp;quot;labelpos&amp;quot;] = &amp;quot;right&amp;quot;;&lt;br /&gt;
             $submenu[&amp;quot;icon&amp;quot;] = &amp;quot;&amp;lt;font color=green&amp;gt;...............&amp;lt;/font&amp;gt;&amp;quot;;&lt;br /&gt;
             $submenu[&amp;quot;link&amp;quot;] = &amp;quot;&amp;lt;font color=green&amp;gt;...............&amp;lt;/font&amp;gt;&amp;quot;;&lt;br /&gt;
             $submenu[&amp;quot;class&amp;quot;] = &amp;quot;submenuitem$ff&amp;quot;;&lt;br /&gt;
             $submenu[&amp;quot;hoverclass&amp;quot;] = &amp;quot;submenuitem_hover$ff&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
             print_menu($menu);&lt;br /&gt;
         ?&amp;gt;&lt;br /&gt;
     &amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;!-- here ends a menu --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With &amp;quot;copy and paste&amp;quot; take this code above and put it between two &amp;lt;td&amp;gt;-blocks, where you would place your new menu-item, as shown in the general menu-structure above. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we will learn how you can change the essental code-lines to do what you want to do. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You have the '''$menu'''-block, which builds the upper-icon you will see on the PGV-page&lt;br /&gt;
and the '''$submenu'''-block, which builds the popup-menu with the submenu-entries on the PGV-page.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can copy this $submenu-block as many times as you need, there is one block for every submenu-entry.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The print_menu-line prints the menu-item (including the submenu-items) to the PGV-page.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Find an meaningful '''label''' for every menu and submenu-entry, for example &amp;quot;my Family&amp;quot; and &amp;quot;where they came from&amp;quot; and write it like this:&lt;br /&gt;
&lt;br /&gt;
             $menu[&amp;quot;label&amp;quot;] = &amp;quot;&amp;lt;font color=green&amp;gt;my Family&amp;lt;/font&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
             $submenu[&amp;quot;label&amp;quot;] = &amp;quot;&amp;lt;font color=green&amp;gt;where they came from&amp;lt;/font&amp;gt;&amp;quot;;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Design a '''new menu-icon''' with a drawing-program or you will find an existing one with Google.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt; Store it with a new name for example &amp;quot;newmenuicon.gif&amp;quot; in the following path:&lt;br /&gt;
&lt;br /&gt;
 /phpGedView/themes/cloudy/images/newmenuicon.gif&lt;br /&gt;
&lt;br /&gt;
and call it in the code like this:&lt;br /&gt;
&lt;br /&gt;
             $menu[&amp;quot;icon&amp;quot;] = &amp;quot;&amp;lt;font color=green&amp;gt;themes/cloudy/images/newmenuicon.gif&amp;lt;/font&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
You can also just use the icon PhpGedView uses for the Welcome Page.&lt;br /&gt;
&lt;br /&gt;
== Open an External Link ==&lt;br /&gt;
&lt;br /&gt;
To open an external link in the '''same browser-window''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            $submenu[&amp;quot;link&amp;quot;] = &amp;quot;http://www.frappr.com&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To open an external link in a '''new browser-window''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            $submenu[&amp;quot;link&amp;quot;] = &amp;quot;http://www.frappr.com\&amp;quot; target=\&amp;quot;_blank\&amp;quot;&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To open an external link in a '''popup-window''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            $submenu[&amp;quot;link&amp;quot;] = &amp;quot;#\&amp;quot; onclick=\&amp;quot;window.open('http://www.frappr.com','','&lt;br /&gt;
               left=50,top=50,width=600,height=320,resizable=1,scroll bars=1'); \&amp;quot;&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
left = distance of the windows from left sideborder&amp;lt;br /&amp;gt;&lt;br /&gt;
top = distance of the windows from upper sideborder&amp;lt;br /&amp;gt;&lt;br /&gt;
width = width of the windows&amp;lt;br /&amp;gt;&lt;br /&gt;
height = height of the windows&amp;lt;br /&amp;gt;&lt;br /&gt;
scrollbars = 1 with scrollbars&amp;lt;br /&amp;gt;&lt;br /&gt;
scrollbars = 0 without scrollbars&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build a new HTML page ==&lt;br /&gt;
Write an HTML (or PHP) page in the usual manner and include all the stories about your family you want to show your users.  Create a &amp;quot;pages&amp;quot; directory in your PhpGedView installation, and place the file here.  For example, save it as http://www.mysite.com/phpgedview/pages/mypage.html.&lt;br /&gt;
&lt;br /&gt;
== Display the HTML page ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;I am not a PHP developer and cannot vouch for the security of this method.  Alternately, you can create a separate page containing all the surrounding code for each page you want to make.&amp;lt;/font&amp;gt;&lt;br /&gt;
Create a file named page.php in your PGV base installation directory, containing this text:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;?php&lt;br /&gt;
    require(&amp;quot;config.php&amp;quot;);&lt;br /&gt;
    print_header(&amp;quot;PhpGedView Page&amp;quot;); ?&amp;gt;&lt;br /&gt;
    include(&amp;quot;pages/&amp;quot;.$_GET[&amp;quot;page&amp;quot;]);&lt;br /&gt;
    print_footer(); &lt;br /&gt;
    ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can then display your pages by going to http://www.mysite.com/phpgedview/page.php?page=mypage.html.  It will be shown with the standard PGV header and footer.  If you want to format all your pages a certain way, like with a block similar to those on the Welcome Page, you can put the code around the include(&amp;quot;pages/&amp;quot;.$_GET[&amp;quot;page&amp;quot;]); line, so you don't have to write it in every html file.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&amp;lt;b&amp;gt;PGV-Sites&amp;lt;/b&amp;gt; with new Menu and Stories around&lt;br /&gt;
* [http://www.lau-net.de/baerlocher/phpGedView Example from Markus (Theme &amp;quot;Cloudy&amp;quot;)]&lt;br /&gt;
* [http://www.finison.com Example from Michael (Theme: slightly-modified Myst)]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;CMS-Sites&amp;lt;/b&amp;gt; with PGV inside &lt;br /&gt;
(see also an [[How_to:Integrate_with_CMS|introduction]] of this)&lt;br /&gt;
* [http://www.thelewisfamily.id.au Example from Laurie (Joomla!)]&lt;br /&gt;
* [http://www.zeisberg-laudert.de Example from Bernd (Joomla!)]&lt;br /&gt;
* [http://www.colt49.com/familyhistory Example from Nigelo (HTML, Theme &amp;quot;Wooden&amp;quot;)] &lt;br /&gt;
* [http://www.our-families.info Example from Nigelo (Joomla!)]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
**********&amp;lt;br/&amp;gt;&lt;br /&gt;
For Markus &amp;lt;br/&amp;gt;&lt;br /&gt;
[[How To:Customize Themes|This is a link to How to customise themes]]&amp;lt;br/&amp;gt;&lt;br /&gt;
[[How To:Customize Themes#Tutorials|This is a link to How to customise themes - Tutorials]]&amp;lt;br /&amp;gt;&lt;br /&gt;
[[How To:Build a New Menu#Open a HTML-Text|This will take you to another sub heading item]]&amp;lt;br /&amp;gt;&lt;br /&gt;
--[[User:Laurie|Laurie Lewis]] 17:34, 12 May 2006 (EST)&lt;br /&gt;
&lt;br /&gt;
[[Category:How To]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Language links...DO NOT DELETE --&amp;gt;&lt;br /&gt;
[[fr: Comment construire un nouveau menu]]&lt;/div&gt;</summary>
		<author><name>Elliott1961</name></author>
		
	</entry>
</feed>