Content Studio Web Content Management System
Assembly: CS_SiteLib (in CS_SiteLib.dll) Version: 5.7.5016.0 (5.7.5016.0)
This is the standard implementation of the WriteOverview method provided by Content Studio.
[This is preliminary documentation and is subject to change.]
Writes the overview part of the web map. This method is called via the Invoke
method. Inheriting classes can override this method to supply their own
rendering code
Namespace: ContentStudio.Site.ActiveScripting.Menu
Assembly: CS_SiteLib (in CS_SiteLib.dll) Version: 5.7.5016.0 (5.7.5016.0)
Syntax
protected virtual void WriteOverview( TextWriter writer, string[] source, StringComparer stringComparer )
Parameters
- writer
- Type: System.IOTextWriter
A TextWriter to write HTML content to - source
- Type: SystemString
The entities that form the web map. Each member in the array is a string with the document name and the its ID separated by a pipe (|) character (example: "My document|1278") - stringComparer
- Type: SystemStringComparer
A StringComparer object used when sorting the source data.
Examples
C#
protected virtual void WriteOverview(System.IO.StreamWriter Writer, string[] Source, StringComparer StringCo) { Writer.Write("<ul"); //Create the skip to content link if (CSSPrefix.Length > 0) WriteAttribute(Writer, " class", (_CSSPrefix + "_Index")); Writer.Write(">" + Environment.NewLine); if (_SkipLinkText.Length > 0) { Writer.Write(" <li"); if (CSSPrefix.Length > 0) WriteAttribute(Writer, " class", _CSSPrefix + "_SkipLink"); Writer.Write(">" + Environment.NewLine); Writer.Write(" <a"); WriteAttribute(Writer, " href", "#CS_WebMapSkipLink" + _ComponentCount.ToString()); Writer.Write(">"); Writer.Write(_SkipLinkText); Writer.Write("</a>" + Environment.NewLine); Writer.Write(" </li>" + Environment.NewLine); } //create a series of links to navigate to each letter section, one item for each unique first letter //found among the document titles. string OldChar = " "; for (int i = 0; i < Source.Length; i++) { if (Source[i].Length > 0) { int linePos = Source[i].IndexOf("|") + 1; if (linePos > 0) { //Data: Name of document|2392 string CurrentChar = Source[i].Substring(0, (Source[i].IndexOf("|") + 1) - 1).Trim(); if ((OldChar.Length > 0) && (StringCo.Compare(CurrentChar.Substring(0, 1), OldChar.Substring(0, 1)) != 0)) { Writer.Write(" <li>" + Environment.NewLine); Writer.Write(" <a"); WriteAttribute(Writer, " href", "#" + CreateCharIndex(CurrentChar) + _ComponentCount.ToString()); WriteAttribute(Writer, " title", CurrentChar.Substring(0, 1)); Writer.Write(">"); Writer.Write(CurrentChar.Substring(0, 1)); Writer.Write("</a>" + Environment.NewLine); Writer.Write(" </li>" + Environment.NewLine); } OldChar = CurrentChar.Substring(0, 1); } } } Writer.Write("</ul>" + Environment.NewLine); } private string CreateCharIndex(string sData) { sData = System.Web.HttpUtility.HtmlEncode(sData.Substring(0, 1)); //* Take the string "charIndex", //* Add the sData after you have removed all occurences of the & # and ; characters //* Finally return the result. return "charIndex" + (sData.Replace("&", "").Replace("#", "").Replace(";", "")); }
See Also