The following example code demonstrates a complete Content Linking component example in one place to illustrate the overall mechanism of the Content Linking component and its accessory content list file.
The scenario is simple. The following set of scripts demonstrates the dynamic construction of the first few pages of an online book introducing programming. There are five content files (Content1.ASP through Content5.ASP). For each file, you want to provide your users with an indicator of current page number (out of the total number of pages), a previous-page link, and a next-page link. You know the content files will change and pages will be inserted and removed often. This is a good example of a programming problem in which the Content Linking component can help.
The following script is the HTML version of the fourth page in our online book:
<HTML> <HEAD><TITLE>Introduction to Programming: Lesson 4 Looping</TITLE></HEAD> <BODY> Welcome to the Introduction to Programming, Lesson 4: Looping.<BR> [TEXT ABOUT LOOPING AND LOOP STRUCTURES] <!-- Begin navigation section construction --> <HR> You are currently viewing page #
5.<BR> Use the following links to navigate:<BR>
<A HREF="Content3.asp">Previous: Lesson 3 Variables</A><BR> <A HREF="Content1.asp">Home: Lesson 1 Introduction</A><BR> <A HREF="Content5.asp">Next: Lesson 5 Pointers</A><BR><!-- End navigation section construction --> </BODY> </HTML>
This HTML page could be easily created by hand ...