Another automatic cascading menu for Actinic 5 onwards. This one allows more modern DHTML effects.
norman
Site Admin
Posts: 1252 Joined: Sat Feb 07, 2004 9:55 pm
Post
by norman » Sat Jul 10, 2004 11:10 am
Here's some example code that if patched into NorCasCade / Advanced / Extra Vars adds a new 5 item top-level menu where the 4th item is the original section tree.
Code: Select all
var top_section_tree_names = new CreateArray(5);
top_section_tree_names[1].sName = "Home";
top_section_tree_names[2].sName = "Cart";
top_section_tree_names[3].sName = "News";
top_section_tree_names[4].sName = "Products...";
top_section_tree_names[4].pChild = section_tree_names; // the Actinic Name Structure goes here
top_section_tree_names[5].sName = "Dummy Nav5";
var top_section_tree_URLs = new CreateArray(5);
top_section_tree_URLs[1].sURL = "index.html";
top_section_tree_URLs[2].sURL = "http://mega/cgi-bin/ca000022.pl?ACTION=SHOWCART";
top_section_tree_URLs[3].sURL = "http://news.bbc.co.uk";
top_section_tree_URLs[4].sURL = "index.html";
top_section_tree_URLs[4].pChild = section_tree_URLs; // the Actinic URL Structure goes here
top_section_tree_URLs[5].sURL = "Dummy Link5";
// now replace the Actinic structures with out modified ones
section_tree_names = top_section_tree_names;
section_tree_URLs = top_section_tree_URLs;
Some of the links are dummy ones (and the Cart one refers to my own test server of course) but I hope there's enough there for you to get the idea.
Norman
Last edited by
norman on Tue Jul 13, 2004 10:57 am, edited 1 time in total.
norman
Site Admin
Posts: 1252 Joined: Sat Feb 07, 2004 9:55 pm
Post
by norman » Tue Jul 13, 2004 10:56 am
And here (courtesy of Hinterglem) is the same sort of thing but with the Actinic Sections as part of the menu's 1st level.
Code: Select all
//Create and populate the name array
var top_section_tree_names = new CreateArray(6 + section_tree_names.length);
top_section_tree_names[1].sName = "Home";
var i = 0;
for (i=2; i <= section_tree_names.length + 1; i++)
{
top_section_tree_names[i] = section_tree_names[i-1];
top_section_tree_names[i].sName = top_section_tree_names[i].sName;
}
top_section_tree_names[section_tree_names.length + 2].sName = "Shopping Basket";
top_section_tree_names[section_tree_names.length + 3].sName = "Checkout";
top_section_tree_names[section_tree_names.length + 4].sName = "Links";
top_section_tree_names[section_tree_names.length + 5].sName = "Site Map";
top_section_tree_names[section_tree_names.length + 6].sName = "Contact Us";
//Create and populate the URL array
var top_section_tree_URLs = new CreateArray(6 + section_tree_URLs.length);
top_section_tree_URLs[1].sURL = "index.html";
var j = 0;
for (j=2; j <= section_tree_URLs.length + 1; j++)
{
top_section_tree_URLs[j] = section_tree_URLs[j-1];
}
top_section_tree_URLs[section_tree_URLs.length + 2].sURL = "http://www.mydomain.com/cgi-bin/ca000001.pl?ACTION=SHOWCART";
top_section_tree_URLs[section_tree_URLs.length + 3].sURL = "http://www.mydomain.com/cgi-bin/os000001.pl?ACTION=Start";
top_section_tree_URLs[section_tree_URLs.length + 4].sURL = "links.html";
top_section_tree_URLs[section_tree_URLs.length + 5].sURL = "site-map.html";
top_section_tree_URLs[section_tree_URLs.length + 6].sURL = "contact-us.html";
//Replace the actinic arrays with the overridden values
section_tree_names = top_section_tree_names;
section_tree_URLs = top_section_tree_URLs;
Norman
bwshop
Posts: 18 Joined: Tue Oct 10, 2006 12:30 pm
Post
by bwshop » Wed Oct 11, 2006 4:34 pm
A quick question - what's the maximum number of 'extra buttons' you can enter into this codin (when you change the Array# also)?
Just out of interest...
norman
Site Admin
Posts: 1252 Joined: Sat Feb 07, 2004 9:55 pm
Post
by norman » Wed Oct 11, 2006 9:06 pm
There's no limit. Just increase both those 6's by whatever you need.
Norman
bwshop
Posts: 18 Joined: Tue Oct 10, 2006 12:30 pm
Post
by bwshop » Thu Oct 12, 2006 9:04 am