The following information is intended for advanced users.
Overview
The Page object provides access to Page-related properties and methods.
Using Script Statements
The script object properties and functions described on this page are typically used in User Item text or static content properties. Script statements in those locations must be delimited by "<%" and "%>":
<% text here is treated as script %>
In addition, when accessing a script object property or function, you typically use the special operator "=" to send the result to the output page:
<%=Page.PersonHREF(1)%>
Properties
All the Page object properties are read-only.
CharacterIndex
Returns the HTML for the Character Index. The result is empty for all pages except the Surname Index.
Description
Returns the page description. For pages created via User Items, Second Site sets Page.Description to the User Item Description.
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 only be specified for a specific 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.
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.
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 only be specified for a specific page for 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.
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.
NextPageItem
Returns an object that includes information about the "Next Page" link for the current page.
Number
Returns the current page number.
PageSet
Returns the name of the current Page Set, for example, "Main Page" or "Surname Index".
PageSetID
Returns the ID of the current Page Set, for example, "mainpage" or "surnameindex".
PageSetID
Returns the number of the current Page Set, for example, 1 or Main Page or 2 for Surname Index.
PreviousPageItem
Returns an object that includes information about the "Previous Page" link for the current page.
Title
Returns the Title of the current page.
Methods
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 tag 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 tag, 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.
PersonHREF(id)
Returns the text for an HTML A tag 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.
PlaceIndexHREF(placeData)
Returns the text for an HTML A element HRef parameter that will open the place index page for the given place. 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. Example:
<a href="<%=Page.PlaceIndexHREF("Ohio;Adams County;Rome")%>">
Rome People
</a>
PlaceInfoHREF(placeData)
Returns the text for an HTML A element HRef parameter that will open the place information page for the given place. 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>
