During initial development, programming tasks comprise much of the work involved in getting a Content Management Server Web site up and running. Some sample code is included with Content Management Server, but almost all Web site development projects will significantly modify this code, so you could start from scratch to produce the customized functionality that is typically required.
A comprehensive demonstration of the types of coding that are common is far beyond the scope of this chapter. Rather, this final section of the chapter will provide detailed explanations of a routine called BuildTopNavTable, implemented in two different ways. First, the routine as it might be coded for a Content Management Server 2001 implementation, using the COM-based Publishing API from Microsoft Visual Basic Scripting Edition (VBScript), will be shown. Second, the routine will be shown as it might be coded for a Content Management Server 2002 implementation, using the .NET-based Publishing API, the .NET Framework, and Visual C#.
Note that unlike the implementation sections in some other chapters, the code in this chapter was not borrowed from an existing product sample. It was devised specifically for this chapter, and has been commented exclusively with annotations in italic font that should not be considered part of the code itself.
The functionality of the routine BuildTopNavTable is the same in both implementations, although some of the details are different. For example, in the COM-based VBScript version, the result is returned as a string that contains the HTML that will display the constructed table. In the .NET Visual C# version, the result is returned as an object of class Table from the namespace System.Web.UI.WebControls, which can then be added to the controls on the page.
The routine is called BuildTopNavTable because it builds a horizontally oriented list of hyperlinks to the top-level channels in a Content Management Server Web site. These hyperlinks are implemented as an HTML table with the following characteristics:
Previous Next |