The NextLink component manages a list of URLs. This enables you to use the pages in a Web site in the order you prefer, like the pages in a book. You can use the Content Linking component to automatically generate and update tables of contents and navigational links to previous and subsequent Web pages. This is ideal for applications such as online newspapers and forum message listings.
This component references a Content Linking List file that contains the list of the linked Web pages. This list is stored on the Web server.
Content Linking List file is a text file that contains a list of Web pages in the order in which they should be displayed. This file must be available on the Web server. It contains one line of text for each URL in the list. Each line contains the URL and a description, and ends with a carriage return. A TAB character separates each item on a line.
Web-page-URL [text-description [,comment]]
NEXTLINK.TXT news1.htm News headlines news2.htm City news news3.htm Sports news4.htm Legislature news news5.htm Editorial
Manages a list of URLs so that you can use the pages in the Web site like the pages in a book.
Retrieves the total number of Web pages listed in the Content Linking List File located on the server.
object.GetListCount( ListURL As String)
Integer.
This example gives the number of entries in the list file.
<% Set NextLink = CreateObject ("MSWC.NextLink")
count = NextLink.GetListCount ("/data/nextlink.txt")
print count %>
Retrieves the index number of the current page in the list file. The current page is the page that loads the NextLink object.
object.GetListIndex( ListURL As String)
Integer.
Returns an integer index value specifying the position of the current page in the list file. The index number of the first item is 1. If the current page is not listed, it returns 0. If the current page is listed more than once, then the function returns the index of its first occurrence. Subsequent entries are ignored.
This example gives the index of the current page.
<% Set NextLink = CreateObject ("MSWC.NextLink")
index = NextLink.GetListIndex ("/data/nextlink.txt")
print index %>
Retrieves the text description of the next item in the Content Linking List File.
object.GetNextDescription( ListURL As String)
String. An ASCII string describing the next item in the list file.
If the current page is not listed, it returns a description of the last page. If the current page is the last item, it returns a description of the first item.
This example gives the description of the next entry in the list file.
<% Set NextLink = CreateObject ("MSWC.NextLink")
Nextdes = NextLink.GetNextDescription ("/data/nextlink.txt")
print Nextdes %>
Retrieves the URL of the next page with respect to the current page.
object.GetNextURL( ListURL As String)
String. URL of the next item in the list file.
If the current page is not listed, it returns the URL of the last page. If the current page is the last item, it returns the URL of the first item.
This example gives the next URL in the list file.
<% Set NextLink = CreateObject ("MSWC.NextLink")
NextURL = NextLink.GetNextURL ("/data/nextlink.txt")
print NextURL %>
Retrieves a text description of the Nth item, defined by the index parameter.
object.GetNthDescrition( ListURL As Sting, Index As Integer)
String.
If index is greater than the number of pages, it returns a description of the first item. If the index is 0, it returns a description of the last item. If the index is a negative number, it returns a description of the first item.
This example gives the description of the third entry in the list file.
<% Set NextLink = CreateObject ("MSWC.NextLink")
NthDes = NextLink.GetNthDescription ("/data/nextlink.txt", 3)
print NthDes %>
Returns the URL of the Nth item in the list file.
object.GetNthURL( ListURL As Sting, Index As Integer)
String.
If index is greater than the number of pages, it returns the URL of the first item. If the index is 0, it returns the URL of the last item. If the index is a negative number, it returns the URL of the first item.
This example gives the URL specified in the 5th entry in the list file.
<% Set NextLink = CreateObject ("MSWC.NextLink")
NthURL = NextLink.GetNthURL ("/data/nextlink.txt", 5)
print NthURL %>
Returns the text description of the previous page with respect to the current page.
object.GetPreviousDescription( ListURL As Sting)
String. Text describing the previous item in the list file.
If the current page is not listed, it returns the description of the first page. If the current page is the first item, it returns the description of the last item.
This example gives the description of the previous entry with respect to the current one in the list file.
<% Set NextLink = CreateObject ("MSWC.NextLink")
Des = NextLink.GetPreviousDescription ("/data/nextlink.txt")
print Des %>
Returns the URL of the previous page with respect to the current page.
object.GetPreviousURL( ListURL As Sting)
String. URL of the previous page.
If the current page is not listed, it returns the URL of the first page. If the current page is the first item, it returns the URL of the last item.
This example gives the URL of the previous entry with respect to the current one in the list file.
<% Set NextLink = CreateObject ("MSWC.NextLink")
URL = NextLink.GetPreviousURL ("/data/nextlink.txt")
print URL %>