From b256462d3380000421da046c71115629e7a76e29 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Fri, 24 Feb 2017 21:05:00 +0100 Subject: Initial commit. --- Templates.md | 215 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 215 insertions(+) create mode 100644 Templates.md (limited to 'Templates.md') diff --git a/Templates.md b/Templates.md new file mode 100644 index 0000000..c066e7c --- /dev/null +++ b/Templates.md @@ -0,0 +1,215 @@ +# Documentation: Templates +**WARNING:** Parameters marked with **{!}** must be escaped from HTML markup if you display them! + + ├── html + │   ├── 403.php + │   ├── 404.php + │   ├── feed + │   │   ├── item_page.php + │   │   ├── item_post.php + │   │   └── main.php + │   ├── home.php + │   ├── main.php + │   ├── page + │   │   ├── item.php + │   │   ├── list.php + │   │   └── main.php + │   ├── pagination.php + │   ├── post + │   │   ├── item.php + │   │   ├── list.php + │   │   └── main.php + │   ├── search + │   │   ├── main.php + │   │   └── result.php + │   └── user + │   ├── item.php + │   ├── list.php + │   └── main.php + ├── lang + │   ├── de.php + │   └── en.php + │   └── […] + └── rsrc + └── […] + +## Template `html/*` +The following variables are available in **each** other template file: + +* `$BLOGMETA['NAME']`**{!}**: Global available: The name of the blog +* `$BLOGMETA['DESC']`**{!}**: Global available: The description of the blog +* `$BLOGMETA['HOME']`**{!}**: Global available: The name of the start page of the blog +* `$BLOGMETA['MAIL']`: Global available: The email address of the contact person +* `$BLOGMETA['LANG']`: Global available: The two-letter language code for the content + +## Template `html/feed/index.php` +Basic framework of the RSS feed in XML which contains a list of page and post items: + +* `$FEED['TYPE']`: Contains a string if a feed for a specific item group is requested (either `post` or `page`) +* `$FEED['LIST']['POSTS']`: Contains a list of post items (or is empty when the "pages-only" feed is requested) +* `$FEED['LIST']['PAGES']`: Contains a list of page items (or is empty when the "posts-only" feed is requested) + +## Template `html/feed/item_page.php` +Represents a single page to display within the feed template. + +* `$PAGE`: [See reference for `@PAGE`] +* `$USER`: [See reference for `@USER`] + +## Template `html/feed/item_post.php` +Represents a single post to display within the feed template. + +* `$POST`: [See reference for `@POST`] +* `$USER`: [See reference for `@USER`] + +## Template `html/page/item.php` +Represents a single page to display within the list template. + +## Template `html/page/list.php` +Overview template which contains the site navigation and a list of page items to be displayed. + +* `$LIST['PAGES']`: Contains a list of page items for the current site +* `$PAGEINATION['THIS']`: Contains the current site number of the list navigation +* `$PAGEINATION['LAST']`: Contains the last site number of the list navigation +* `$PAGEINATION['HTML']`: Contains the pageination template with the list navigation + +* `$PAGE`: [See reference for `@PAGE`] + +## Template `html/page/main.php` +Main template for a single page. + +* `$PAGE`: [See reference for `@PAGE`] +* `$USER`: [See reference for `@USER`] +* `$PAGE['PREV']`: Same data structure as `$PAGE` but with the data from the previous page +* `$PAGE['NEXT']`: Same data structure as `$PAGE` but with the data from the next page + +## Template `html/post/item.php` +Represents a single post to display within the list template. + +## Template `html/post/list.php` +Overview template which contains the site navigation and a list of post items to be displayed. + +* `$LIST['POSTS']`: Contains a list of post items for the current site +* `$PAGEINATION['THIS']`: Contains the current site number of the list navigation +* `$PAGEINATION['LAST']`: Contains the last site number of the list navigation +* `$PAGEINATION['HTML']`: Contains the pageination template with the list navigation + +* `$POST`: [See reference for `@POST`] + +## Template `html/post/main.php` +Main template for a single post. + +* `$POST`: [See reference for `@POST`] +* `$USER`: [See reference for `@USER`] +* `$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 + +## Template `html/search/index.php` +Search template without results and with the formular. + +* `$SEARCH['TEXT']`**{!}**: Contains the full search string +* `$SEARCH['INFO']`**{!}**: Contains a list of information messages +* `$FORM['SELECT']['D']`: Contains the selected day or is empty +* `$FORM['SELECT']['M']`: Contains the selected month or is empty +* `$FORM['SELECT']['Y']`: Contains the selected year or is empty +* `$FORM['OPTIONS']['D']`: Contains a list of possible days to select +* `$FORM['OPTIONS']['M']`: Contains a list of possible months to select +* `$FORM['OPTIONS']['Y']`: Contains a list of possible years to select + +## Template `html/search/result.php` +Result template with a list of posts and the formular to repeat the search. + +* `$SEARCH['TEXT']`**{!}**: Contains the full search string +* `$SEARCH['INFO']`**{!}**: Contains a list of information messages +* `$RESULT['LIST']`: Contains a list of post items as result +* `$FORM['SELECT']['D']`: Contains the selected day or is empty +* `$FORM['SELECT']['M']`: Contains the selected month or is empty +* `$FORM['SELECT']['Y']`: Contains the selected year or is empty +* `$FORM['OPTIONS']['D']`: Contains a list of possible days to select +* `$FORM['OPTIONS']['M']`: Contains a list of possible months to select +* `$FORM['OPTIONS']['Y']`: Contains a list of possible years to select + +## Template `html/user/main.php` +Main template for a single user. + +* `$USER`: [See reference for `@USER`] +* `$USER['PREV']`: Same data structure as `$USER` but with the data from the previous user +* `$USER['NEXT']`: Same data structure as `$USER` but with the data from the next user +* `$COUNT['POST']`: Contains the number of posts published by the user +* `$COUNT['PAGE']`: Contains the number of pages published by the user + +## Template `html/403.php` +Default template for error page 403 Forbidden. + +*[no variables]* + +## Template `html/404.php` +Default template for error page 404 Not Found. + +*[no variables]* + +## Template `html/home.php` +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 +* `$PAGEINATION['HTML']`: Contains the pageination template with the list navigation + +## Template `html/main.php` +Basic framework of the HTML document which contains the main content: + +* `$HEAD['NAME']`**{!}**: Contains the document name for the `` tag or something else +* `$HEAD['DESC']`**{!}**: Contains the document description for `<meta` tags or something else +* `$HEAD['PERM']`: Contains the canonical URL for this document +* `$HEAD['OG_IMAGES']`: Contains a list of image URLs for the document +* `$HTML`: Contains the documents main body (other templates) + +## Template `html/pageination.php` +Contains the site navigation for post, page and user list (and for the home template) + +* `$THIS`: Contains the current site number of the list navigation +* `$LAST`: Contains the last site number of the list navigation +* `$HREF`: Contains the URL for a specific site number + +## References to reduce duplicate text + +### `@PAGE` +* `$PAGE['ID']`: Contains the unique ID of the page +* `$PAGE['URL']`: Contains the complete URL to the page content +* `$PAGE['GUID']`: Contains a pseudo-guid of the page +* `$PAGE['FILE']['LIST']`: List of extracted image URLs from the body +* `$PAGE['BODY']['TEXT']`: Pre-parsed content of the page body +* `$PAGE['BODY']['HTML']`: HTML parsed content of the page body +* `$PAGE['ATTR']['USER']`: Raw attribute data from database column `user` +* `$PAGE['ATTR']['SLUG']`**{!}**: Raw attribute data from database column `slug` +* `$PAGE['ATTR']['NAME']`**{!}**: Raw attribute data from database column `name` +* `$PAGE['ATTR']['BODY']`**{!}**: Raw attribute data from database column `body` +* `$PAGE['ATTR']['TIME_INSERT']`: Raw attribute data from database column `time_insert` +* `$PAGE['ATTR']['TIME_UPDATE']`: Raw attribute data from database column `time_update` + +### `@POST` +* `$POST['ID']`: Contains the unique ID of the post +* `$POST['URL']`: Contains the complete URL to the post content +* `$POST['GUID']`: Contains a pseudo-guid of the post +* `$POST['FILE']['LIST']`: List of extracted image URLs from the body" +* `$POST['BODY']['TEXT']`: Pre-parsed content of the post body +* `$POST['BODY']['HTML']`: HTML parsed content of the post body +* `$POST['ATTR']['USER']`: Raw attribute data from database column `user` +* `$POST['ATTR']['SLUG']`**{!}**: Raw attribute data from database column `slug` +* `$POST['ATTR']['NAME']`**{!}**: Raw attribute data from database column `name` +* `$POST['ATTR']['BODY']`**{!}**: Raw attribute data from database column `body` +* `$POST['ATTR']['TIME_INSERT']`: Raw attribute data from database column `time_insert` +* `$POST['ATTR']['TIME_UPDATE']`: Raw attribute data from database column `time_update` + +### `@USER` +* `$USER['ID']`: Contains the unique ID of the user +* `$USER['URL']`: Contains the complete URL to the user +* `$USER['GUID']`: Contains a pseudo-guid of the user content +* `$USER['FILE']['LIST']`: List of extracted image URLs from the body +* `$USER['BODY']['TEXT']`: Pre-parsed content of the user body +* `$USER['BODY']['HTML']`: HTML parsed content of the user body +* `$USER['ATTR']['SLUG']`**{!}**: Raw attribute data from database column `slug` +* `$USER['ATTR']['BODY']`**{!}**: Raw attribute data from database column `body` +* `$USER['ATTR']['USERNAME']`**{!}**: Raw attribute data from database column `username` +* `$USER['ATTR']['FULLNAME']`**{!}**: Raw attribute data from database column `fullname` +* `$USER['ATTR']['MAILADDR']`**{!}**: Raw attribute data from database column `mailaddr` +* `$USER['ATTR']['TIME_INSERT']`: Raw attribute data from database column `time_insert` +* `$USER['ATTR']['TIME_UPDATE']`: Raw attribute data from database column `time_update` \ No newline at end of file -- cgit v1.2.3