A page contains all information to display a page on your website frontend.

Get any field's content using the field method.

All other data can be found in the public properties.

Variables

@:keepread onlyallow_children:Bool

This page can have children

@:keepread onlyapi:Api

@:keepread onlychannel:String

The channel key

@:keepread onlycreated:Float

Returns a timestamp of the time this page was created

@:keepread onlydata:JSONValue

An object containing all raw field data, use field method to get processed data

@:keepread onlyfields:Array<String>

An array containing all field keys

@:keepread onlyfull_path:String

A full path including path from parents. (eg. "/blog/item")

@:keepread onlyid:Int

Returns the id of this page's entry

@:keepread onlykey:String

The page key, or empty if not set

@:keepread onlylanguage:String

The language key (eg. "en")

@:keepread onlymetadata:Metadata

An object holding all metadata, see Metadata

@:keepread onlymodified:Float

Returns a timestamp of the last time this page was modified

@:keepread onlyorder:Int

The order number of this entry amongst his siblings

@:keepread onlyorder_by:OrderBy

The sorting order as defined in the entry settings

@:keepread onlypath:String

A slug, usually derived from the page title (eg. "/item")

@:keepread onlysort:SortDirection

The sorting order (asc/desc) as defined in the entry settings

@:keepread onlytitle:String

The page title

Methods

@:has_untyped@:value({ extras : true, channels : null })@:keepchildrenToJson (?options:ToJsonOptions, ?channels:Array<String>, extras:Bool = true):Array<JSONValue>

@:value({ raw : false })@:keepfield (key:String, raw:Bool = false):Dynamic

Returns data of the field identified by key. Type of return is different based on the field's content.

If the field's content is text, it will return a String.

If the field is an image, this will return an instance of ImageHandler which you can use to transform the image.

If the field is a collection, it will return an array containing FieldApi instances.

@:keepgetChild (position:Int, ?keys:Array<SortKey>):PageApi

Returns the child on the given position This function assumes there is only 1 allowed channel and all children have this channel

@:keepgetChildByPath (path:String):Null<PageApi>

Returns child with a certain path if found

@:has_untyped@:keepgetChildren ():Array<PageApi>

Gets all of this page's children

@:has_untyped@:value({ amount : 40 })@:keepgetChildrenSubset (startPos:Int, amount:Int = 40, ?keys:Array<SortKey>):Array<PageApi>

Returns a subset of all the children based on the given position and amount This function assumes there is only 1 allowed channel and all children have this channel

@:keepgetNext (?keys:Array<SortKey>):PageApi

Returns the next page amongst all the children of his parent (with the same channel)

@:keepgetNextGlobal (?keys:Array<SortKey>):PageApi

Returns the next page amongst all the pages with this channel

@:keepgetNumberOfChildren (?keys:Array<SortKey>):Int

Returns the amount of children this page taking sorting criteria into account (min and max criteria influence the result) This function assumes there is only 1 allowed channel and all children have this channel

@:keepgetParent ():PageApi

Gets the parent page

@:has_untyped@:keepgetParents ():Array<PageApi>

Get all of the page's parents

@:keepgetPosition (?keys:Array<SortKey>):Int

Returns the position of this page amongst all the children of his parent (with the same channel)

@:keepgetPositionGlobal (?keys:Array<SortKey>):Int

Returns the position of this page amongst all the pages with this channel

@:keepgetPrevious (?keys:Array<SortKey>):PageApi

Returns the previous page amongst all the children of his parent (with the same channel)

@:keepgetPreviousGlobal (?keys:Array<SortKey>):PageApi

Returns the previous page amongst all the pages with this channel

@:has_untyped@:value({ amount : 10 })@:keepgetRecentlyModifiedChildren (amount:Int = 10):Array<PageReference>

Returns all child entries that were recently modified

@:has_untyped@:keepgetReferencedImagePaths (keyToWysiwyg:String):Array<String>

Returns all the image paths contained in this Wysiwyg

@:keepgetTranslation (lang:String):PageApi

Returns the translated page in the given language

@:keepisChildOf (entryID:Int):Bool

Check if this page has the given entry id as one of his parents

@:value({ extras : true })@:keeptoJson (?options:ToJsonOptions, extras:Bool = true):JSONValue

Returns a processed representation of all the data data in this page.

Static methods

@:keepstaticcreate (api:Api, version:EntryVersion):PageApi

@:keepstaticcreateFromEntry (api:Api, entry:Entry, language:String):PageApi

@:keepstaticcreateFromEntryLanguage (api:Api, lang:EntryLanguage):PageApi