Pages API

by Justin Bodeutsch, Benson Lee | Last edited: 7/16/2012

Display mode: detail

The pages API only has a single display mode: detail. Including this parameter is optional.

Show

Here are the tags available to show in page detail:

TagDescription
__title__ the page title
__slug__ the URL safe version of the title (more info)
__url__ A full path to the page. If the page lives in multiple places in the nav, just one will be returned.
__groupslug__ returns group slug this page belongs to. Will not return site-group. If the page is associated with multiple groups, will return the first group associated in alphabetical order.
__description__ the page description
__tags__ Comma separated list of keywords
__taglinks__ Comma separated list of keywords in links. By default links to /tags/tag-slug/. Otherwise use __taglinks url='/some/url/'__
__text__ The page content
Any Custom Fields setup for Pages will output their API tags

Parameters

find

Will accept the slug of a page.

Example:

"find:page-slug",

Normally used to dynamically find the correct page:

"find:".$_GET['nav'],

privatelink

If the page is set to private, users will be directed to this page. If they are logged out they will be presented with a link to the specified page. If they are logged in and not a member of the private group, they will automatically be redirected.

"privatelink:http://google.com",

"privatelink:/member-login/",

Header Images

Pages also support header images. This code snippet pulls the header image associated with the current page:

getContent(
      "media",
      "display:detail",
      "find:".$_GET['nav'],
      "label:header",
      "show:<img src="__imageurl__" alt="__name__" id="subpage_header" />"
    );

User-Selectable Sections

Templates enabled for pages can also support sections that users can select on a per-page basis. See the Sections API for more information on this capability.