Announcement

Collapse
No announcement yet.

Top-level section URLS not working in menu

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

    Top-level section URLS not working in menu

    Hi,

    I was using Yahoo style lists to create a side menu listing the top-level sections of a client's site. The client then added sub-menus, which they did not want to appear in the navigation.

    I added the following to the document HEAD

    <!--@act NETQUOTEVAR:TOPLEVELSECTIONS_URLS -->

    and this to the relevant menu area:

    <div id="nav">
    <div id="navinner">
    <ul>
    <li><a href="/index.html" class="menu">Home</a></li>
    <li><a href="NETQUOTEVAR:NAVBCATALOGLINK" class="menu">Shop</a><br />
    <SCRIPT LANGUAGE="JavaScript" SRC="Act_sections_URLs.js">
    </SCRIPT></li>
    <li><a href="delivery.html" class="menu">Delivery</a></li>
    <li><a href="contact.html" class="menu">Contact Us</a></li>
    <li><a href="terms.html" class="menu">Terms</a></li>
    </ul>
    </div>
    </div>


    but nothing is working.

    I don't know if I'm doing something wrong, or whether there's a way to use the Yahoo style lists but modify them so only the top-level shows?

    The URI is:

    http://www.minimicro.co.uk/ (shop section)

    Thank you.

    Giselle

    #2
    Replace
    <SCRIPT LANGUAGE="JavaScript" SRC="Act_sections_URLs.js">
    </SCRIPT>
    with
    Code:
    <SCRIPT LANGUAGE="JavaScript">
    document.write(YahooSections(sections)) 
    </SCRIPT>
    Last edited by wjcampbe; 30-Sep-2005, 12:16 PM. Reason: add closng tag for code
    Bill
    www.egyptianwonders.co.uk
    Text directoryWorldwide Actinic(TM) shops
    BC Ness Solutions Support services, custom software
    Registered Microsoft™ Partner (ISV)
    VoIP UK: 0131 208 0605
    Located: Alexandria, EGYPT

    Comment


      #3
      I tried that - do I need a script in the head?

      Hi,

      Thanks for that. I'm getting a Jscript undefined error. Which script do I need in the head of the document?

      At the moment I've got:

      <!--@act NETQUOTEVAR:SECTIONTREE_RAW -->

      <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
      <!--
      function YahooSections(ar)
      {
      var strIDs = '';
      for (var i=1;i<=ar.length;i++)
      {
      if (ar[i].sURL != null)
      {
      strIDs += '<a href="' + ar[i].sURL + '"><span class="">' +

      ar[i].sName + '</span></a><br />';
      {
      if (ar[i].pChild)
      {
      for (var j=1;j<=ar[i].pChild.length;j++)
      {
      if (ar[i].pChild[j].sURL != null)
      {
      strIDs += '<a href="' + ar[i].pChild[j].sURL + '">' +

      ar[i].pChild[j].sName + '</a><br />';
      }
      }
      }
      }
      strIDs += '<br />'
      }
      }
      return strIDs
      }
      //-->
      </SCRIPT>

      Thanks again,

      g

      Comment


        #4
        Just noticed you are using a bulleted list style - you may want this code from the AUG

        In the head section
        Code:
        <!--@act NETQUOTEVAR:TOPLEVELSECTIONS_RAW -->
        <SCRIPT LANGUAGE = JavaScript>
        <!--
        function BulletList(pItem)
        {
        var strIDs = '<ul>';
        {
        for (var i = 1; i <= pItem.length; i++)
        {
        strIDs += '<li><a href=' + pItem[i].sURL + '>'+ pItem[i].sName + '</a></li>';
        }
        }
        strIDs += '</UL>'
        return strIDs
        }
        -->
        </SCRIPT>
        and in the menu area
        Code:
        <script language=Javascript1.2>
        document.write(BulletList(sections))
        </script>
        Bill
        www.egyptianwonders.co.uk
        Text directoryWorldwide Actinic(TM) shops
        BC Ness Solutions Support services, custom software
        Registered Microsoft™ Partner (ISV)
        VoIP UK: 0131 208 0605
        Located: Alexandria, EGYPT

        Comment

        Working...
        X