CustomPage

An object representing a custom page.

A custom page consists of CustomPageItems that are located in the items property.

Properties

The properties of the object.

Property Description
baseName The base name that is used when generating a URL for the custom page, by language. Unless otherwise specified, baseName is generated from name.
hidden Whether the custom page should be hidden.
items An array of unique identifiers for CustomPageItems.
metaDescription Text to be used for the HTML meta element named "description", by language.
metaKeywords Text to be used for the HTML meta element named "keywords", by language.
name Name by language.
pageTitle The page title, by language.
uid The unique identifier of a custom page.
url URL to the custom page by language.

Methods

count

Takes a filter object and returns the number of custom pages found, as an integer.

Parameters

A filter object specifying which custom pages to count. See Filter objects on the page List selection.

Example

The request below returns the number of custom pages where the name in English starts with "Terms".

API Console
CustomPage.count(
  {
    "/name/en": {
      "startsWith": "Terms"
    }
  }
)
Response
1

get

Fetches information about a custom page.

Parameters

Parameter Description
uid The unique identifier of a custom page.
query Which info to return. See Query language.

Example

API Console
CustomPage.get(9871251, true)
Response
{
  "uid": 9871251,
  "name": {
    "en": "Check this out!",
    "sv": "Kolla in det här!"
  },
  "url": {
    "en": "http://shop.example.com/check-this-out",
    "sv": "http://shop.example.com/se/shopwindow.php?id=816751&shopwindow=9871251"
  },
  "hidden": false,
  "metaDescription": {
    "en": "Buy a great variety of exotic fruits.",
    "sv": "Köp exotiska frukter av alla de slag."
  },
  "metaKeywords": {
    "en": "exotic,fruit",
    "sv": "exotisk,frukt"
  },
  "items": [719035, 8251723, 371953, 561896]
}

list

Fetches multiple custom pages as an array of custom page objects.

Parameters

Parameter Description
query Which info to return. See Query language.
selection Which custom pages to list. See List selection.

Example

The following request returns the names and URLs of all the custom pages where the names in English start with "Terms":

API Console
CustomPage.list({"url": {"en": true},"name": {"en": true}}, {"filters": {"/name/en": {"startsWith": "Terms"}}})
Response
[
  {
    "name": {
      "en": "Terms & conditions"
    },
    "url": {
      "en": "http://www.example.com/en/terms-and-conditions.html"
    }
  },
]

getSchema

Fetches the JSON Schema which can be used for client-side validation.

Parameters

The unique identifier of a custom page or null for a new instance.

Example

API Console
CustomPage.getSchema(null)
Response
{
  "title": "CustomPage",
  "type": "object",
  "properties": {
    "uid": {"type": "integer"},
    "name": {
      "type": "object",
      "format": "byLanguage",
      "properties": {
        "en": {"title": "English", "type": "string"},
        "sv": {"title": "Svenska", "type": "string"}
      }
    },
    "url": {
      "type": "object",
      "format": "byLanguage",
      "properties": {
        "en": {"title": "English", "type": "string"},
        "sv": {"title": "Svenska", "type": "string"}
      }
    },
    "hidden": {"type": "boolean"},
    "metaDescription": {
      "type": "object",
      "format": "byLanguage",
      "properties": {
        "en": {"title": "English", "type": "string"},
        "sv": {"title": "Svenska", "type": "string"}
      }
    },
    "metaKeywords": {
      "type": "object",
      "format": "byLanguage",
      "properties": {
        "en": {"title": "English", "type": "string"},
        "sv": {"title": "Svenska", "type": "string"}
      }
    },
    "items": {
      "type": "array",
      "items": {"type": "integer"}
    }
  }
}