Supporting Function for ASP

When you perform a server installation of Consolo with the Congifuration Tool, you can also install supporting functions for ASP. The file inc_getStructure.asp will then be included. You will find it in Consolo’s system folder consolo/. The file contains the supporting function getStructure() which analyzes the page structure file consolo/register/structure.xml and generates a <ul><li>-formatted list.

If you don’t have this file, you can download it here ». Note that in inc_getStructure.php you have to replace the text %subfolder% with the name of the folder on the server in which Consolo is installed.

The function has to be included on all the pages that will be generating the page structure, but it is recommended to make the request through another script, which in turn is included on every page. This will make it easier to change the request in the future, and have the change implemented all over the web site at once. For example, you can create a file inc/incHeader.asp that you include in the beginning of every page. The file incHeader.asp can look like this:

<!-- #INCLUDE VIRTUAL='/consolo/inc_parseStructure.asp' -->
<div id="wrap">
    <div id="header">
        <p>Place for page header </p>
    </div>

    <div id="navigation_top">
        <% Response.Write getStructure(1, 1, False, "") %>
    </div>

    <div id= "content">

 

As you can see, a request is sent to getStructure. The request only calls the first level of the structure. The function is called like this:

getStructure(iFromLevel, iToLevel, bExpandAll, sHeader)

 

Parameters

Name

Meaning

Description

iFromLevel

From level

Integer which sets the initial level of the list.

iToLevel

To level

Integer which sets the end level of the list.

bExpandAll

Expand all

Boolean which decides wether all folders should expand. If False, only the active folder, if existing, will expand.

sHeader

Header

String with a header for the list to begin with. If sHeader = “auto” and iFromLevel is greater than 1, a header will be added automatically. < /SPAN >

 

 

Example 1: Top Navigation. Get all the pages at the first level.

Response.Write getStructure(1, 1, False, "")

 

Example 2: Sub-Navigation. Get all the pages from level two to four.

Response.Write getStructure(2, 4, False, "auto")

 

Example 3: Complete structure, but only get pages up to level five.

Response.Write getStructure(1, 5, True, "My website")

 

Example 4: Complete structure, but only expand the current search path.

Response.Write getStructure(1, 99, False, "My website")