Making a Menu
 
Friday, September 27, 2002  

In looking at various example sites available, I have discovered four different ways to make a site menu which, in most cases, runs down the left side of a page, though placement is a matter of style and taste.

Variable
Create a variable with a meaningful name, such as menuMain. In the Value window, enter the links that you want for your menu. In the templates, reference the variable by name using the CityDesk notation {$.menumain$}. I find it is easiest to use a text editor such as Notepad to do the tagging and then to copy and paste the text into the Value window. John Conners has a template (here) that uses variables extensively. John created a menu using a variable, and then inserted the menu variable into the PageTop variable.

Article
This is a two step set up. First, create a variable, such as menuMain. In the Value window, enter the following:

{$foreach x in (filename "menuMain")$}{$x.body$}{$next$}

Next, create an article (use the Simple template) called menuMain. Make a list of link titles, hightlight the text, click on the link icon, and select the CityDesk article you want to link to. If you want to do fancy things, then go into the HTML View of the article and play with the tagging. Darren Collins uses this technique in his template for Non-Profits here.

Scripting
Joel uses CityDesk scripting to auto-generate a menu. His template is here. This is worth a look if only to get ideas about other uses of CityDesk scripting.

Javascript
TK has a example site that uses javascript to handle navigation. The template is here. I'm not strong on javascript, but the ideas presented look pretty slick.

For what it's worth, I prefer the Article technique. The menu is readily available, easy to edit, easy to manipulate and it does what I want it to do. Granted, it requires manual maintenance when you want to add links to the menu, but that doesn't happen too often.