A frontend is used to easily get content in the form of pages. Pages contain all information you might need in the frontend of your website. See PageApi for more info.

Use a frontend to display content.

Variables

@:keepread onlyapi:Api

@:keepread onlycontentModified:Float

Returns a timestamp of the last time any content in this site was modified

@:keepread onlylanguage:String

The language this site instance uses

Methods

@:has_untyped@:keepbasicSearch (query:String, from:Int, amount:Int, ?channels:Array<String>):Array<PageReference>

Returns all references to pages with a title containing the search query

@:keepcountPages (criteria:SortingCriteria):Int

Count the number of pages for certain sorting criteria

@:keepcountSearch (query:String, ?channels:Array<String>):Int

Returns the amount of pages with a title containing the search query

@:keepgetPageByID (id:Int):PageApi

Returns a PageApi instance based on an entry ID

@:keepgetPageByKey (key:String):PageApi

Returns a PageApi instance based on an entry key, which can be set in the settings tab

@:keepgetPageByPath (path:String):PageApi

Returns a PageApi instance based on an path. The path is expected to exactly match the full_path of an Entry. Strip any base dirs or query before requesting.

@:keepgetPageOnPosition (criteria:SortingCriteria, position:Int):PageApi

Get the page on the given position, this is the position this page would have when all pages are sorted with the given criteria.

@:keepgetPagePosition (criteria:SortingCriteria, page:PageApi):Int

Get the position a certain page would have when all pages of this channel are sorted with the given criteria.

@:has_untyped@:keepgetPagesEndingWithPathPiece (pathPiece:String):Array<PageApi>

Returns all PageApi instances of which the path ends with the given piece.

@:has_untyped@:keepgetPagesSorted (criteria:SortingCriteria, ?from:Int, ?amount:Int):Array<PageApi>

Get all pages sorted by the given criteria

@:has_untyped@:value({ amount : 10 })@:keepgetRecentlyModifiedEntries (amount:Int = 10, ?excludedChannels:Array<String>):Array<PageReference>

Returns all entries that were recently modified

@:has_untyped@:keepgetSitemap ():Array<String>

Get all paths in the project

@:has_untyped@:value({ levels : 1 })@:keepgetStructure (ids:Array<Int>, levels:Int = 1):Array<StructureNode>

Get a structure of all children levels deep. Can be used to build a site's menu.

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

Returns all the top pages in this project

@:has_untyped@:keepsearch (query:String, from:Int, amount:Int, ?channels:Array<String>):Array<PageApi>

Returns all pages with a title containing the search query

@:has_untyped@:keepsearchDocument (query:String, from:Int, amount:Int):Array<FileReference>

Returns all references to pages with a title containing the search query

@:keepsetSorting (channel:String, keys:Array<SortKey>):Void

Set the sorting order used for a certain channel. In order to use this functionality you need to define an index in the CMS for this channel/key.