menu.gp



Creator information
Current maintainer :Max Maischein
Author(s) :Max Maischein
Recipe homepage :<none>

Version history
The documentation file was last modified on Tue Nov 29 18:22:58 2016.

Overview
menu.gp is a simple site navigation system.
Compatible Genpage Versions
Version 1.0.3 and above.
Syntax
menulink( aPagegloss, aDescription )

menulink() returns
<A HREF="gloss(aPagegloss)">aDescription</A>
if aPagegloss does result in an URL that does not link to the current page and it returns
<B>aDescription</B>
if aPagegloss results in an URL to the current page.
This is quite convenient to use in a navigation bar, where the current page will automatically be displayed in bold and all other links will remain normal links.

aPagegloss must be an entry in your glossary that resolves to a local URL to a page (that is, no "http://" at the start of the URL). Using the glossary for page links helps you to keep all your references between pages in one easy to edit place.


Examples

First of all, the file menu.gp must be included in some content by using <!-- _GP_ recipe( "menu.gp" ) -->.

An example for a navigation bar in template.html is like follows (assuming that template.html will be used to create both, the homepage and the filepage) :

<CENTER>
[
  <!-- _GP_ menulink("ex_homepage", "Home") --> |
  <!-- _GP_ menulink("ex_filepage", "Downloads") --> |
  <!-- _GP_ menulink("ex_email", "Contact") -->
]
</CENTER>
Which will look like the following :

[ Home | Downloads | Contact ]

For the page with the filepage gloss, the same code will result in HTML that looks like the following :
[ Home | Downloads | Contact ]


The menu separator (in this example "|") is not part of menu.gp ! It must be specified separately. This is, so that you could also use menu.gp in another fashion, as a navigation bar to the left of your page :

<TABLE width="100%"><TR><TD width="80" bgcolor="#D0D0FF"><!-- Site Menu -->
<TABLE width="100%">
  <TR><TD><!-- _GP_ menulink("ex_homepage", "Home") --><TD></TR>
  <TR><TD><!-- _GP_ menulink("ex_filepage", "Downloads") --></TD></TR>
  <TR><TD><!-- _GP_ menulink("ex_email", "Contact") --></TD></TR>
</TABLE></TD><TD valign="top" bgcolor="#F0F0C8">
And here goes the fabulous content of the page ... Who needs frames anyway ?
</TD></TABLE>

This would then look like this (never mind the color choices !):

Home
Downloads
Contact
And here goes the fabulous content of the page ... Who needs frames anyway ?


To-do List

Known Bugs
None known :)

Back to Top


This page generated using Genpage - Version: 1.0.7 on Wed Nov 30 16:34:11 2016

© Max Maischein
1999