Pages are divided into sections, and the content and format of each section is determined by a short, single-purpose script file called a Page Script. Second Site includes a library of Page Scripts, and users can choose a script for each page segment based on their preferences.
Second Site sets the initial value of all the Page Script options to reasonable choices, and so many users will not have to change any Page Script values. The Initial Values section of this page explains those choices in more detail.
Some users may want to alter how Second Site maps the content to page sections or make other adjustments. This section explains many of the options.
Page Section Scripts
Page Scripts are assigned to each major page section, and can vary by Page Set. There are four main page sections: Menu, Header, Content, and Footer.
The Menu Script determines the content of the four menu areas on the page, the Top menu, MenuBar, Sidebar, and Bottom menu. The Standard script is the best choice for most pages; it implements the choices indicated by the User Items.
The Header Script determines the contents of the header section. The header section contains the page title, site title, site subtitle, and extra header content defined by the user.
- This script creates a header section that displays all the fields listed above. The script also supports an optional "site icon", a graphic file that appears in the header and is intended to brand your site.
- Left-Hand Frame Header
- This script is designed for use with pages that are loaded in the thin, left-hand frame of framed sites. This script is assigned to the proper page sets when switching to a framed site.
- Page Title Only
- This script omits all header content except the page title. It is primarily intended as an option for the left-hand frame in a framed site, but it may also be used for other PageSets if desired.
- No Header
- This script suppresses all the usual header content. It inserts the Extra Header content, if any.
When there is no content, the empty #header DIV element will still be part of the page, and by default that container includes padding, so an empty header will still be visible. You can use a pageset-specific User Style to hide the #header entirely. For the Main Page PageSet, for example:
selector-1: #mainpage #header parameters-1: display: none;
- No Page Number
- This script is similar to the Standard script but omits the page number on numbered pages such as person pages and source pages.
- No Page Title
- This script is similar to the Standard script but omits the page title. The site title is rendered with an H1 element.
- No Site Title
- This script is similar to the Standard script but omits the site title.
- This script includes a welcome graphic file and is intended for the Main Page of sites that use one of the Carla's Graphics Themes.
- With Page Description
- This script is similar to the Standard script but adds the page description.
The Content Script controls the main section of the page. In most cases, the user will not change the Content script because Second Site sets it to the proper value based on the Page Set. Some advanced users may choose to create their own Content scripts.
- This script produces the usual output which has the Page Description (if any), then the Page Content, then the Extra Content.
- Extra at Top
- This script is similar to the Standard script but places the Extra Content above the Page Content.
- No Page Description
- This script is the same as the Standard script except it suppresses the Page Description, if any.
- Main Page
- This script is designed for the main page of the site.
- Surname Index
- This script has special features to produce the surname character index and other features of the Surname Index.
- Surname Index with Extra at Top
- This script is the same as the Surname Index script but places the Extra Content above the Page Content.
- Image Page
- This script is used for linked Image Pages. It is not suitable for other uses. It places the image caption above the image and other elements associated with the exhibit below the image.
- Image Page with Bottom Caption
- This script is used for linked Image Pages. It is not suitable for other uses. It is the same as the Image Page script except the caption is placed beneath the image.
- Image Page with Exh Description
- This script is used for linked Image Pages. It is not suitable for other uses. It is the same as the Image Page script except the exhibit description, if any, is included beneath the image.
- Image Page with Wide Exh Description
- This script is used for linked Image Pages. It is not suitable for other uses. It is the same as the Image Page with Exh Description script except it accommodates wide exhibit descriptions.
The Footer Script determines the content and structure of the footer section. The Standard script creates a footer that includes:
- compiler information, details of which are controlled by the Compiler script (below),
- the bottom menu, details of which are controlled by a function in the Menu script (above),
- a build information section that respects the property setttings from the Build section of the user interface.
The Head Script choice determines the contents of the HTML HEAD element. The HEAD element of an HTML page includes tags that do not create visible content, but affect the page in other ways.
- This script creates standard META tags and other tags necessary for a proper web site.
- Standard Static
- This script is the same as the Standard script above but it omits the viewport META tag that instructs mobile devices not to scale the page. This script will result in the page being considered unfriendly to mobile devices and should only be used in special circumstances. Make sure you combine the Standard Static script with a static Layout such as "1 Col S Con Side+Xtra".
- Mark of the Web
- This script adds a Mark of the Web comment to the web pages. See the linked page for an explanation of Mark of the Web.
Second Site supports static content that is added to the HEAD element of the page, so it is unlikely that users will have to create their own Head scripts.
Other Page Scripts
These scripts affect other page content.
- The Compiler Script formats the information supplied by the user in the Compiler section of the user interface. There are two choices, Standard and Multi-Line Format.
- The Common Script contains functions used by the other Page Scripts and can be ignored by users.
Page Set-Specific Page Scripts
Page Scripts may be assigned to all the pages in a site by setting property values in the Default Layout section. Page Scripts may be assigned to a specific Page Set by setting property values in the section for that Page Set.
As defined below in the Initial Values section, Second Site sets some Page Set-specific scripts in all new SDF files.
Second Site assigns Page Script choices as follows when you create a new SDF file:
- All the Page Script properties in the Default Layout section are set to Standard. The Standard script for each page section is appropriate for most Page Sets and complements the other default values.
- The Main Page.Content Script is set to Main Page. On the Main Page, the Extra Content is the only content, and the specialized script adjusts for that condition.
- The Surname Index.Content Script is set to Surname Index, a script that adds the character index links to the top of the Surname Index page.
- The Chart Pages.Menu Script is set to MenuBar Items in SideBar. This script treats User Items with Menu=MenuBar as if they were set to Menu=SideBar.
This choice is complementary with the Chart Pages.Layout value of 2 Col Chart Side Con BE. The combination of those two choices moves the MenuBar items to a left-hand Sidebar, which is a good arrangement for wide chart pages. In some Themes, the items in the MenuBar are right-adjusted, and on a page with wide content, the menu items would be off-screen to the right until the page was scrolled in that direction.
- The Image Page.Content Script is set to Image Page, a script that creates the page contents based on exhibit properties. Another script option for Image Pages is Image Page with Exh Description, a script that adds the exhibit's Description field below the image. The Image Page script omits the exhibit Description.
Those values will produce good results for most sites. There are additional script options for most of the Page Script properties. Their names indicate what they do.
Sometimes, Page Scripts should be used in pairs. For example, User Items include a Description field that is a "Page Description" for User Items that create pages such as the Custom Page User Item. When using the standard scripts, the Page Description appears at the top of the Content section. You can move the Page Description to the Header section by combining these script choices:
- Default Layout.Header Script = With Page Description
- Default Layout.Content Script = No Page Description
To move the Page Description from the Content section to the Header section only for Custom Pages and other user-generated pages, change those properties in the User Pages section only:
- User Pages.Header Script = With Page Description
- User Pages.Content Script = No Page Description
These Page Scripts have been written or updated since the current version of Second Site was released. You may download them by clicking on the link. The link is an archive file that contains the script file.
Note: There are no pending scripts at this time.
Custom Page Scripts
The following information is intended for advanced users.
Page Scripts are stored in subfolders beneath the Scripts folder. The Scripts folder and subfolders can be extended via the User Data Folder (UDF) mechanism, so advanced users can create custom Page Scripts if necessary.
Each Page Script file defines at least one function that returns page content. The name of the function varies by the type of script.
Page Scripts scripts have access to the following objects and methods.
- The Page Object provides page-specific information such as the page number.
- The Site Object provides site information and a set of built-in functions such as Wrapper().
- The Common Script provides a set of utility functions for use by other scripts. I do not recommend that users customize the Common script. Most of the functions in the Common Script are complex and closely tied to the internal data formats of Second Site.
- The Database Object provides database information.
This page last changed on 02 May 2018.