The function.The function generates a collection of unordered lists from a link in a menu item. It opens the links in a new window. Since the index is generated at runtime from the menu data, it should always accurately reflect your current menu navigation. The links in the index window control navigation in the parent window.
Things of Note
- images if you use images rather than text that item is shown as 'undefined'. The first item of the sample is an image only item. Item two is the same item but with text. Generate the site index to note the results for them.
- as a side note Though the module is designed to generate a
siteindex from, and for use with, the Milonic Menu system, there are other things you might do with
the generated page.
- It could be saved and used to check links with a link checker program. Because this is generted at runtime, this could be useful to make sure no links are broken, particularly offsite links.
- The generated page might also be used as a sitemap, making it easy to keep your sitemap current. You might need to modify the page for such use so view the source and make any changes you deem necessary before uploading it as your sitemap. You may wish to set window attributes and have it open links in its parent window, for example.
The parameters.mm_siteIndex() is the function name. It takes three  parameters.
- indexHeading is a string to use as the textual heading that will appear at the top of the site index window. The heading uses the <h1> tag, and can therefore be styled by applying css rules to <h1> in a style sheet.
- cssFile (this attribute is optional) It is a string containing the path and filename of a .css file that you want to apply to the site index window. If cssFile is not specified, the browser's default styling will apply. The site index window uses the following tags that you may want to style: <body>, <h1>, <ul>, <li>, ..
- Download the mm_siteIndex.js file.
- Edit your menu_data.js file and create the aI string where you want the link to generate the site index.
- Place the call for the file wherever you want, you could even put it in an include file
Modifying The Parameters
- The aI string which
generates the page in this sample is:
- You can modify the parameters for the windowAttributes, indexHeading and the optional cssFile
where itemText is the text that you want to appear in the menu item, 'windowAttributes' are the placement, dimensions, attributes such as toolbar that you want for the window that will open, indexHeading is the Heading [text] that will appear at the top of the window, and cssFile is the file you have created for the css style of the page being opened. This is an optional attribute and does not need to be included if you don't want to apply css styles to the page. If you do not include css the aI string would be as follows
Find out more about window attributes and what can be use here.