Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: Site map auto-generated by MENU_ITEMS
franklamoureux
Newbie

Posts: 1
Registered: 3/18/2005
Location: Québec
Member Is Offline
posted on 3/18/2005 at 01:19 PM Reply With Quote
Site map auto-generated by MENU_ITEMS


Here is a way to generate a site map automatically using your pre-configured menu variable MENU_ITEMS. Enjoy !!

In your site_map.html page, just use
-------------------------------------------
<script language="JavaScript" src="js/menu.js"></script>
<script language="JavaScript" src="menu_items.js"></script>
<script>
new ShowMap (MENU_ITEMS);
</script>
-------------------------------------------

And add the following to menu.js
-------------------------------------------
// This will produce a site map using MENU_ITEMS
function ShowMap (a_items) {

this.a_config = a_items;
this.a_children = [];
this.n_depth = -1;

// init items recursively
for (n_order = 0; n_order < a_items.length; n_order++)
new show_item(this, n_order);


}
// Recursive function that creates the map.
function show_item (o_parent, n_order) {

this.n_depth = o_parent.n_depth + 1;
this.a_config = o_parent.a_config[n_order + (this.n_depth ? 3 : 0)];

// return if required parameters are missing
if (!this.a_config) return;

// store info from parent item
this.o_parent = o_parent;
this.n_order = n_order;

// generate item's HMTL
if (n_order == 0) document.write("<ul>");

if (this.a_config[1] == null) {
html = this.a_config[0] + "<br>n";
} else {
html = '<a class=none href="' + this.a_config[1] + '"'
+ (this.a_config[2] && this.a_config[2]['tw'] ? ' target="'
+ this.a_config[2]['tw'] + '"' : '') + '>'
+ this.a_config[0] + "</a><br>";
}
document.write (html);


// no more initialization if leaf
if (this.a_config.length < 4)
return;

// node specific methods and properties
this.a_children = [];

// init downline recursively
for (var n_order = 0; n_order < this.a_config.length - 3; n_order++)
new show_item(this, n_order);

if (o_parent.n_depth < this.n_depth) document.write("</ul>");
if (this.n_depth== 0) document.write("<br>");
}
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page Tigra Menu
Product Demonstrations Live Demos:
Traditional Blue
White Steps
Inner HTML
All Together
Frames Targeting
Free Download Free Download
Free Download Menu Builders
Online Builder
Builder for Windows
Product Documentation Documentation:
Documenation Page
Change Log
Menus Comparison Table
Support Forum Support Forum
 
Tigra Menu PRO
Product Demonstrations Live Demos
Alignment & Multimenus
Unlimited Depth
Item sizing and positioning
Inner HTML
Frames, Targeting
Static Positioning
Free Download Menu Builders
Online Builder
Product Documentation Documentation
Documenation Page
Tigra Menu PRO FAQ
Change Log
Menus Comparison Table
Support Forum Technical Support
Support Forum
Customer Care System
Order Now ORDER NOW!
Add to Cart
View Cart
 
Product Page Tigra Menu GOLD
Functionality demos Functionality demos
Multiple
Cross-framed
Select-boxes
Effects
Design demos Design demos
Icons & arrows
Idea!
Hi there!
Matrix
MS Style
XP Style
Dots
3D-Buttons
Product Documentation Documentation
Documenation Page
Change Log
Menus Comparison Table
Support Forum Technical Support
Support Forum
Customer Care System
Order Now ORDER NOW!
Add to Cart
View Cart
 

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004