Predefined variables

    Koblog provides a few predefined variables to help developers:

    $content and $staticContent

    Those two content are array giving you all the relevant pages of a context. Each page included in the array is a Page Object.

    • The $content variable contain all the published pages (it includes published pages and sticky, but does not include statics). They're context-relevant, which mean in a tag, you'll just have the list of pages relevant to that tag, for instance. They're also paginated. The array is ordered by date or by position, and you can change this behavior in the settings of your system.
    • The $staticContent variable is an array with all the static pages. The array is ordered by position by design.

    Take a look at the code snippets to know how to work with these variables.

    $page

    The $page variable represents whichever page the user is browsing. The variable is a Page Object.

    For example, if the user is browsing at https://www.example.com/my-dog-rules, the $page variable has the page object for the key, e.g. my-dog-rules.

    Databases variables

    • The $pages variable is a Pages Object. This object is used to manipulate the page database.
    • The $tags variable is a Tags Object. This object is used to manipulate the tag database.
    • The $categories variable is a Categories Object. This object is used to manipulate the category database.
    • The $archives variable is a Archives Object. This object is used to manipulate the archive database (article by years or month)
    • The $authors variable is a Authors Object. This object is used to manipulate the authors database (taxonomy based on which account wrote the article)
    • The $kinds variable is a Kinds Object. This object is used to manipulate the post kinds database.
    • The $medias variable is a Kinds Object. This object is used to manipulate the global media database.
    • The $emojis variable is a Emojis Object. This object is used to manipulate the emojis database (taxonomy based on which account wrote the article)