Help And Documentation

2: Object Reference

2.5: The Page Object

A Page object allows you to easily show different content depending on which current URL segment has been visited. URL segments are values in the URL which are separated by forward slash characters. For example, if a Page object has been added to the Site object then the very first URL segment will be the current URL segment. When you use the Set Address method then the Page object will execute if the value matches what is in the current URL segment and the next URL Segment will now become the current URL segment.

If you use the Add Segment Variable method then values from the URL will be put into variables and the current URL segment will also change.

Example: the following URL has 4 URL segments: 'viewUser/3/viewMessages/unread'

An initial page object could sets its address as 'viewUser' and add one segment variable which would create a variable which has a value of '3'. A second page object that is added to the first could set its address as 'viewMessages' and add one segment variable which would create a variable which has a value of 'unread'.


Set Address

This method can only be used once.

Only execute this page if the current URL segment value matches this address value.

If the value does match then the current URL segment will be changed to the next URL segment.

Parameters

Name Text Variable Object Array Description
Segment Yes Yes No No Value to compare the current URL segment.

Add Segment Variable

This method can be used multiple times.

This method can be used to set a data variable.

Set a variable with a specific name with the value of the current URL segment. The current URL segment will be changed to the next URL segment.

Parameters

Name Text Variable Object Array Description
Data Variable Name Yes No No No Name of the variable to be set.

Add Content

This method can be used multiple times.

Add content and objects to be shown if this page is shown.

Parameters

Name Text Variable Object Array Description
Content Yes Yes Yes No Content or objects to be shown.

Add Page Attributes

This method can only be used once.

Add text on to the end of the site's title, description and keywords that have already been set by the Site object and any other Page objects before this one.

Parameters

Name Text Variable Object Array
Title Yes Yes Yes No
Description Yes Yes Yes No
Keywords Yes Yes Yes No

Add CSS File

This method can be used multiple times.

Link to a CSS file if this page is shown.

Parameters

Name Text Variable Object Array
File Yes No No No

Add Javascript File

This method can be used multiple times.

Include a JavaScript file if this page is shown.

Parameters

Name Text Variable Object Array
File Yes No No No

Set Default

This method can only be used once.

Execute this page if the current URL value is empty.

Parameters

This method doesn't contain any parameters.


Set 404 Content

This method can be used multiple times.

This method allows you to add content that will be shown if this Page object doesn't find any other Page objects in its content that return their own content. This means that it is possible for another Page object added to this Page object to match the correct URL but still trigger the 404 content if it doesn't return any of its own content.

Parameters

Name Text Variable Object Array
Content Yes Yes Yes No

Next Page » « Previous Page