Announcement

Collapse
No announcement yet.

Creating a List of Hyperlinks with Sections and Sub-sections

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

    Creating a List of Hyperlinks with Sections and Sub-sections

    This code will lay out your sections and sub-sections within a list of hyperlinks (first depth of sub-sections only). The sub-sections will appear indented.

    Paste the following code just above the </head> tag in your overall page layout:

    HTML Code:
    <actinic:variable value="All Data From All Sections" name="JavaScriptArray" />
    
    <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
    <!--
    function SectionList(ar)
    {
    var strIDs = '<table border=0 width=95% cols=2>';
    
    for (var i=1;i<=ar.length;i++)
    {
    if (ar[i].sURL !=null)
    {
    strIDs += '<tr><td colspan=2><a href="' + ar[i].sURL + '"><span class="actxxsmall">' + ar[i].sName + '</span></a></td></tr>';
    {
    if (ar[i].pChild)
    {
    for (var j=1;j<=ar[i].pChild.length;j++)
    {
    if (j <= ar[i].pChild.length)
    {
    strIDs += '<tr><td><img src=shim.gif width=5></td><td><a href="' + ar[i].pChild[j].sURL + '"><span class="actxxsmall">' + ar[i].pChild[j].sName + '</span></a></td></tr>';
    }
    }
    }
    }
    }
    }
    strIDs += '</table>'
    return strIDs
    }
    //-->
    </SCRIPT>
    And then insert the following code in the main body of the page where you want the list to appear.
    HTML Code:
    <script language=Javascript1.1>
    document.write(SectionList(section_tree))
    </script>
    For more information about creating section lists with javascript see this article
Working...
X