PageSeries

Package: Libraries.Web.Series · Inherits from: Libraries.Language.Object

PageSeries is an ordered list of pages that belong together, such as the lessons of a course. A page can be in any number of series. A series has a name, a short key used in addresses (such as "scenes"), a description, and the location of its overview page. A series can also list pages the website doesn't build itself, by title and location, so pages made in different ways can share one series.

Example Code

use Libraries.Web.Series.PageSeries

PageSeries scenes
scenes:SetName("Scene Editing")
scenes:SetKey("scenes")
scenes:SetOverviewLocation("tutorials/Scenes/index.html")
scenes:AddOutsidePage("Creating a scene project", "tutorials/Scenes/create.html")

Actions

Add(Libraries.Web.Page.WebPage page)

Adds a page the website builds to the end of the series. Its title and location come from the page.

Parameters

AddOutsidePage(text title, text location, text summary)

Adds a page the website doesn't build to the end of the series, by its title, location and summary. The summary is shown where the page is suggested next.

Parameters

  • title text: The page's title.
  • location text: The page's location on the site, with no leading slash.
  • summary text: One or two sentences on what the page teaches.

AddOutsidePage(text title, text location)

Adds a page the website doesn't build to the end of the series, by its title and location.

Parameters

  • title text: The page's title.
  • location text: The page's location on the site, with no leading slash.

AddPart(text location)

Adds a page as part of the entry added last, such as the second problem in a set of problems whose entry is the set's first. The page shows that entry as its place in the series (its navigation marks it), but it isn't an entry itself, so the series' list and its count don't change. The entry's own page may be added as a part too, so it is treated like the entry's other parts (its breadcrumbs name the entry, as theirs do).

Parameters

  • location text: The page's location on the site, with no leading slash.

Example

use Libraries.Web.Series.PageSeries

PageSeries problems
problems:SetName("Practice Problems")
problems:AddOutsidePage("Output", "problems/output/start.html")
problems:AddPart("problems/output/change.html")

Contains(text location)

Returns true if the series has a page at a location.

Parameters

  • location text: The page's location.

Returns

boolean: Whether the page is in the series.

GetDescription()

Sets a short description of the series, for its overview page and for search engines.

Returns

text

GetEntry(integer position)

Returns the page at a position in the series, from 0.

Parameters

  • position integer: The position.

Returns

Libraries.Web.Series.PageSeriesEntry: The entry at that position.

GetImage()

Sets a picture for the series, shown where the series is listed, such as a card for each course.

Returns

text

GetKey()

Sets the series' key: a short name used in addresses to say which series a reader is following, such as "scenes". Lowercase letters, digits and hyphens only.

Returns

text

GetName()

Sets the series' name, as readers see it.

Returns

text

GetOverviewLocation()

Sets where the series' overview page goes, on the site.

Returns

text

GetPosition(text location)

Returns a page's position in the series, from 0, or -1 if it isn't in the series. A part (AddPart) has its entry's position.

Parameters

  • location text: The page's location.

Returns

integer: The position, or -1.

GetSize()

Returns how many pages are in the series.

Returns

integer: The number of pages.

IsPart(text location)

Returns true if the page at a location is part of an entry (added with AddPart), not an entry itself.

Parameters

  • location text: The page's location.

Returns

boolean: Whether it is a part.

SetDescription(text description)

Sets a short description of the series, for its overview page and for search engines.

Parameters

  • description text: The description.

SetImage(text location)

Sets a picture for the series, shown where the series is listed, such as a card for each course.

Parameters

  • location text: The picture's address, as pages link to it.

SetKey(text key)

Sets the series' key: a short name used in addresses to say which series a reader is following, such as "scenes". Lowercase letters, digits and hyphens only.

Parameters

  • key text: The key.

SetName(text name)

Sets the series' name, as readers see it.

Parameters

  • name text: The name, such as "Scene Editing".

SetOverviewLocation(text location)

Sets where the series' overview page goes, on the site.

Parameters

  • location text: The location, with no leading slash.

Inherited Actions

3 actions from Libraries.Language.Object