Overview

The following information is intended for advanced users.

The Page object provides access to Page-related properties and methods.

For general instructions on using script statements, see the Script Usage page.

Properties

All the Page object properties are read-only.

Page.CharacterIndex

Returns the HTML for the Character Index. The result is empty for all pages except the Surname Index.

Page.Description

Returns the page description. For pages created via User Items, Second Site sets Page.Description to the User Item Description.

Page.ExtraContent

Returns the Extra Content text for the current page. Standard Page Scripts add this text to either the Default Layout.Extra Content value or the Page Set-specific property value.

Extra content can be specified for a single page for Custom Pages. In all other cases, user-specified Extra content can only be set via the Static Content properties and that text is not returned by the Page.ExtraContent property.

Page.Frame

For framed sites (see Layouts Section), returns "ssindex" for pages that are loaded in the index frame and "ssmain" for pages that are loaded in the main frame. For non-framed sites, returns an empty string.

Page.HeadTags

Returns HTML tags for the current page that should be included in the HEAD element of the page. Standard Page Scripts add this text to either the Default Layout.Extra Head value or the Page Set-specific property value.

HEAD tags can be specified for a single page for Custom Pages and Custom Pages. In all other cases, user-specified HEAD tags can only be set via the Static Content properties and that text is not returned by the Page.HeadTags property.

Page.HasPageNumber

Returns true if the current page has a page number and is part of a set of pages which should include "Previous Page" and "Next Page" links.

Page.NextPageItem

Returns an object that includes information about the "Next Page" link for the current page.

Page.Number

Returns the current page number.

Page.PageSet

Returns the name of the current Page Set, for example, "Main Page" or "Surname Index".

Page.PageSetID

Returns the ID of the current Page Set, for example, "mainpage" or "surnameindex".

Page.PageSetNumber

Returns the number of the current Page Set, for example, 1 for Main Page or 2 for Surname Index.

Page.PreviousPageItem

Returns an object that includes information about the "Previous Page" link for the current page.

Page.Title

Returns the Title of the current page.

Methods

Page.Cite()

Page.Cite(sourceNumber, text)

Page.Cite() adds a citation to the current page and returns a citation reference number as a superscript. Page.Cite() is intended for use on Custom Pages and when combined with Page.CitationList() produces output that is similar to the citations that are automatically added to person page entries as a result of source citations in the TMG project.

For sourceNumber, specify a TMG source number or zero. For text, specify the text you want to use as the citation detail for the citation.

Page.Cite() produces the equivalent of an embedded citation, and it uses the same infrastructure within the Second Site program.

Examples

For all of the following examples, add the following Page.CitationList() call at the end of the Main Content section of the page:

  <%=Page.CitationList("Citations")%>
Example 1
He is the most experienced researcher for the Smith
family.<%=Page.Cite(4,"self-proclaimed")%>

Please note that if you place multiple Page.Cite() calls in a row to cite multiple sources, you have to supply superscripted commas yourself:

Example 2
He is the most experienced researcher for the Smith
family.<%=Page.Cite(4,"self-proclaimed")%><sup>,</sup>
<%=Page.Cite(62,"page 19, dissenting opinion")%>

Any source that you reference via the sourceNumber parameter will be included on a source page. If you do not want to cite a source, but instead want to add a text footnote that will appear in the page's citation list, set the source number to zero.

Example 3
<%=Page.Cite(0,"This footnote doesn't link to a source.")%>

Using Page.Cite() in the SideBar or Extra Content sections is not recommended because of difficulty ensuring that the Page.Cite() calls are executed after the Page.CitationList() call.

Page.CitationList()

Page.CitationList(sectionTitle)

Page.CitationList() produces a list of the Page.Cite() citations for the current page. Page.CitationList() creates HTML that is very similar to the HTML Second Site creates for the person page citation lists.

The Page.CitationList() method must occur after all calls to the Page.Cite() method. As a result, you should put the citation list at the end of the main content area.

If you want a section header prior to the list, you must supply the sectionTitle in the Page.CitationList() call. If you specify an empty sectionTitle, the Page.CitationList() call will not add a section header to the page.

Examples

For all of the following examples, add one or more Page.Cite() calls above the Page.CitationList() call shown below.

Example 1

A citation list with a section header:

<%=Page.CitationList("Citations")%>
Example 2

A citation list without a section header:

<%=Page.CitationList("")%>

Page.ExhibitHRef()

Page.ExhibitHRef(Topic)

Returns the text for an HTML A element HRef parameter that will open the exhibit page for a linked exhibit with the given Topic.

When Second Site re-makes a site, exhibit page numbers may change due to changes in the TMG project. If you manually create HTML that links to an exhibit page, use the Page.ExhibitHRef() function to ensure that the HRef will be correct.

Example

<a href="<%=Page.ExhibitHRef("J. Smith, 1928")%>">
Picture of Mr. J. Smith, circa 1928
</a>

It is up to you to ensure that the given exhibit has a linked exhibit page. If two or more exhibits have the same topic, Second Site will return a link to the first exhibit it finds.

Page.GetPageImage()

Page.GetPageImage(imageCode, imageID, alt, title)

Returns an IMG tag for the image with the given image code. If a Page Set-specific version of the image exists, the IMG element will specify that version.

Second Site image codes are basically filenames with no filtetype; Second Site looks for an image with a name that matches the given image code and with a filetype of "gif", "jpg", or "png", in that order, and selects the first one it finds. This makes scripts more flexible; the user can provide images with any of the accepted HTML filetypes and the scripts will find the image.

GetPageImage first looks for an image that has the image code that is the concatenation of the given image code and the current Page Set number. If no such image is found, Second Site looks for an image with the given image code only.

If one of those two files exists, Second Site creates an HTML IMG element, including the width and height of the image (as determined by opening the image file), and appends an ID=, ALT=, and TITLE= parameter to match the imageID, alt, and title parameters from the GetPageImage function call.

Page.PersonHRef()

Page.PersonHRef(ID)

Returns the text for an HTML A element HRef parameter that will open the person page entry for the person in the database with the given ID number.

See the Page.PersonHRef Example and the description of the [PageLink] and [PageHRef] codes.

Page.PlaceIndexHRef()

Page.PlaceIndexHRef(placeData)

Returns the text for an HTML A element HRef parameter that will open the place index page for place indicated by placeData. The place subfields must be specified in reverse sequence, with place levels separated by semi-colons. For example, "Massachusetts;Essex County;North Andover". Specify only the place levels you have selected for the place index.

Example

<a href="<%=Page.PlaceIndexHRef("Ohio;Adams County;Rome")%>">
Rome People
</a>

Page.PlaceInfoHRef()

Page.PlaceInfoHRef(placeData)

Returns the text for an HTML A element HRef parameter that will open the place information page for the place indicated by placeData. The place data must be specified in reverse sequence, with place levels separated by semi-colons. For example, "Massachusetts;Essex County;North Andover". Specify only the place levels you have selected for the place index and for which there is either a place comment or place exhibit.

Example

<a href="<%=Page.PlaceInfoHRef("Ohio;Adams County;Rome")%>">
Rome Information
</a>
On This Page