summaryrefslogtreecommitdiffstats
path: root/Templates.md
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2021-07-01 22:12:51 +0200
committerThomas Lange <code@nerdmind.de>2021-07-01 23:13:51 +0200
commit4490330658ffa05f3709c078224c4607acf0b4bd (patch)
treeac47987e08cab3e0d004ddd2f3f3bff65e59a7fb /Templates.md
parent5f62e251b85c9e5b9c64423c829f25137970484a (diff)
downloadwiki-4490330658ffa05f3709c078224c4607acf0b4bd.tar.gz
wiki-4490330658ffa05f3709c078224c4607acf0b4bd.tar.xz
wiki-4490330658ffa05f3709c078224c4607acf0b4bd.zip
Add documentation for category system
Diffstat (limited to 'Templates.md')
-rw-r--r--Templates.md61
1 files changed, 59 insertions, 2 deletions
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