Announcement

Collapse
No announcement yet.

Adding buttons to norcascade manually?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Adding buttons to norcascade manually?

    Hi,

    Question about Norcascade:

    Thanks for your great norcascade script Norman. If I can get it working how I need it, I pledge to donate to both yourself and the twinhelix chap for every implementation I make (I am just starting up doing web design commercially) Creep creep.

    Anyway, is it possible to add buttons manually - ie not relating to sections, but to other actinic pages (like shopping cart and checkout)? I want a 'home' button, followed by all the top-level sections, followed by shopping cart, checkout, site map etc. and have been trying to do this by careful positioning of my buttons either side of the norcasace menu.

    It works fine in IE and Opera, but the style settings are inconsistent in NN and Firefox (I can't seem to get my buttons to be rendered exactly the same as the norcascade buttons), therefore, I was wondering whether I could lump them all together within the norcascade structure?

    For an example of what I mean, try viewing the following page in IE (which looks fine), and then in NN. test page

    Thanks in advance for any help - and that pledge to donate is not just words you know!

    #2
    Norcascade creates a file pop_style.css containing the style info for the menu items. You could try applying those classes to your own buttons. That way they'd all be working from the same stylesheet.

    An alternative (and much more complex solution) would be to use the NorCascade / Advanced / Extra Vars to add in some JavaScript that modifies the Actinic section tree structures to make them sub-arrays if a new top-level array set that contains your own set of buttons. Thus all the navigation would be done via NorCascade. Not a trivial (or cheap) task but one I'd be happy to quote you for.

    Norman
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Another (belated) thought. You can have more than one TwinHelix menu on your page. Info on that would be from the TwinHelix documentation.

      Norman
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


        #4
        It turned out to be not too hard after all. 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:
        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 our 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
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          Excellent, thanks Norman - I'll give it a try.

          Comment


            #6
            We've got 2 twin helix menu systems on this site

            http://www.jfs-security.co.uk/index.htm

            Comment


              #7
              Many thanks for pointing me in the right direction. I managed to achieve the effect I was looking for using the following:

              Code:
              //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;
              I will contact you by e-mail to sort out the £££

              Comment


                #8
                That should work just fine.

                I've copied the code ( with a credit to you of course ) into my own NorCascade forum ( www.drillpine.biz/forums/ ) as it will be useful there.

                Norman
                Norman - www.drillpine.biz
                Edinburgh, U K / Bitez, Turkey

                Comment


                  #9
                  See www.drillpine.biz/forums/ where there's info on extending NorCascade.

                  PS I'm thinking of removing NorCascade from my downloads as the number of people using it (as evidenced by the number asking for support, etc) hugely exceeds the number donating. Angus (www.twinhelix.com) who wrote the DHTML bit that powers NorCascade wrote to me a few days ago confirming this. He was googling for sites using it and was very disappointed in the honesty shown out there.
                  Norman - www.drillpine.biz
                  Edinburgh, U K / Bitez, Turkey

                  Comment

                  Working...
                  X