From 4490330658ffa05f3709c078224c4607acf0b4bd Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Thu, 1 Jul 2021 22:12:51 +0200 Subject: Add documentation for category system --- Templates.md | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 59 insertions(+), 2 deletions(-) (limited to 'Templates.md') diff --git a/Templates.md b/Templates.md index d58e6b1..841287f 100644 --- a/Templates.md +++ b/Templates.md @@ -3,6 +3,10 @@ ├── html │   ├── 403.php │   ├── 404.php + │   ├── category + │   │   ├── item.php + │   │   ├── list.php + │   │   └── main.php │   ├── feed │   │   ├── item_page.php │   │   ├── item_post.php @@ -50,8 +54,12 @@ Basic framework of the HTML document which contains the main content: * `$HEAD['OG_IMAGES']`: Contains a list of image URLs for the document * `$HTML`: Contains the documents main body (other templates) -**If you are on a page, post or user site:** -* `$TYPE`: Contains either `PAGE`, `POST` or `USER` as string value. +**If you are on a single category, page, post or user:** +* `$TYPE`: Contains either `CATEGORY`, `PAGE`, `POST` or `USER` as string value. + +**If `$TYPE` is `CATEGORY`:** +* `$CATEGORY`: [See reference for `@CATEGORY`] +* `$CATEGORIES`: Contains a list of `@CATEGORY` arrays (the parents and the direct category itself) **If `$TYPE` is `PAGE`:** * `$PAGE`: [See reference for `@PAGE`] @@ -70,6 +78,14 @@ This is the default startpage template which contains a list with the last posts * `$LIST['POSTS']`: Contains a list of post items for the home site * `$PAGINATION['HTML']`: Contains the pagination template with the list navigation +## Category List Template `html/category/list.php` +Overview template which contains the site navigation and a list of category items to be displayed. + +* `$LIST['CATEGORIES']`: Contains a list of category items for the current site +* `$PAGINATION['THIS']`: Contains the current site number of the list navigation +* `$PAGINATION['LAST']`: Contains the last site number of the list navigation +* `$PAGINATION['HTML']`: Contains the pagination template with the list navigation + ## Page List Template `html/page/list.php` Overview template which contains the site navigation and a list of page items to be displayed. @@ -94,6 +110,15 @@ Overview template which contains the site navigation and a list of user items to * `$PAGINATION['LAST']`: Contains the last site number of the list navigation * `$PAGINATION['HTML']`: Contains the pagination template with the list navigation +## Category Item Template `html/category/item.php` +Represents a single category to display within the list template. + +* `$CATEGORY`: [See reference for `@CATEGORY`] +* `$CATEGORIES`: Contains a list of `@CATEGORY` arrays (the parents and the direct category itself) +* `$IS_ROOT`: Boolean if this category item is in the root list or if it is a child of some category +* `$COUNT['POST']`: Contains the number of posts published in this category +* `$COUNT['CHILDREN']`: Contains the number of children categories + ## Page Item Template `html/page/item.php` Represents a single page to display within the list template. @@ -105,12 +130,26 @@ Represents a single post to display within the list template. * `$POST`: [See reference for `@POST`] * `$USER`: [See reference for `@USER`] +* `$CATEGORY`: [See reference for `@CATEGORY`] +* `$CATEGORIES`: Contains a list of `@CATEGORY` arrays (the parents and the direct category itself) ## User Item Template `html/user/item.php` Represents a single user to display within the list template. * `$USER`: [See reference for `@USER`] +## Category Main Template `html/category/main.php` +Main template for a single category. + +* `$CATEGORY`: [See reference for `@CATEGORY`] +* `$CATEGORIES`: Contains a list of `@CATEGORY` arrays (the parents and the direct category itself) +* `$COUNT['POST']`: Contains the number of posts published in this category +* `$COUNT['CHILDREN']`: Contains the number of children categories +* `$CATEGORY['PREV']`: *NOT IMPLEMENTED YET* +* `$CATEGORY['NEXT']`: *NOT IMPLEMENTED YET* +* `$LIST['CATEGORIES']`: Contains a list of direct children categories +* `$LIST['POSTS']`: Contains a list of post items in this category + ## Page Main Template `html/page/main.php` Main template for a single page. @@ -124,6 +163,8 @@ Main template for a single post. * `$POST`: [See reference for `@POST`] * `$USER`: [See reference for `@USER`] +* `$CATEGORY`: [See reference for `@CATEGORY`] +* `$CATEGORIES`: Contains a list of `@CATEGORY` arrays (the parents and the direct category itself) * `$POST['PREV']`: Same data structure as `$POST` but with the data from the previous post * `$POST['NEXT']`: Same data structure as `$POST` but with the data from the next post @@ -199,6 +240,22 @@ Default template for error page 404 Not Found. ## References to reduce duplicate text +### `@CATEGORY` +* `$CATEGORY['URL']`: Contains the complete URL to the category content +* `$CATEGORY['GUID']`: Contains a pseudo-guid of the category +* `$CATEGORY['ARGV']`: Contains the arguments parsed as key->value array +* `$CATEGORY['FILE']['LIST']`: List of extracted image URLs from the body +* `$CATEGORY['BODY']['TEXT'] ()`: Pre-parsed content of the category body +* `$CATEGORY['BODY']['HTML'] ()`: HTML parsed content of the category body +* `$CATEGORY['ATTR']['ID']`: Raw attribute data from database column `id` +* `$CATEGORY['ATTR']['PARENT']`: Raw attribute data from database column `parent` +* `$CATEGORY['ATTR']['SLUG']`**{!}**: Raw attribute data from database column `slug` +* `$CATEGORY['ATTR']['NAME']`**{!}**: Raw attribute data from database column `name` +* `$CATEGORY['ATTR']['BODY']`**{!}**: Raw attribute data from database column `body` +* `$CATEGORY['ATTR']['ARGV']`: Raw attribute data from database column `argv` +* `$CATEGORY['ATTR']['TIME_INSERT']`: Raw attribute data from database column `time_insert` +* `$CATEGORY['ATTR']['TIME_UPDATE']`: Raw attribute data from database column `time_update` + ### `@PAGE` * `$PAGE['URL']`: Contains the complete URL to the page content * `$PAGE['GUID']`: Contains a pseudo-guid of the page -- cgit v1.2.3