template:twigstarter
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
template:twigstarter [2019-05-25 10:04] – andi | template:twigstarter [2021-11-23 10:56] – [Variables and Functions] andi | ||
---|---|---|---|
Line 5: | Line 5: | ||
author | author | ||
email : andi@splitbrain.org | email : andi@splitbrain.org | ||
- | lastupdate_dt : 2019-05-24 | + | lastupdate_dt : 2020-07-07 |
compatible | compatible | ||
depends | depends | ||
Line 11: | Line 11: | ||
similar | similar | ||
screenshot_img: | screenshot_img: | ||
- | tags : starter, !experimental, twig, sidebar | + | tags : starter, twig, sidebar |
downloadurl | downloadurl | ||
Line 22: | Line 22: | ||
The template is meant as an alternative to the [[template: | The template is meant as an alternative to the [[template: | ||
- | |||
- | Note: this is currently experimental as there are no templates that have been built on top of this, yet. | ||
===== Getting started ====== | ===== Getting started ====== | ||
Line 30: | Line 28: | ||
DokuWiki expects three files in a template directory: '' | DokuWiki expects three files in a template directory: '' | ||
+ | |||
+ | |||
+ | > There' | ||
Depending on what way you want to use, there are different things to do: | Depending on what way you want to use, there are different things to do: | ||
Line 39: | Line 40: | ||
==== TwigStarter Child ==== | ==== TwigStarter Child ==== | ||
- | If you want to depend on the original twigstarter template, copy over all files except for | + | If you want to depend on the original twigstarter template, copy over the following |
- | * '' | + | * '' |
- | * '' | + | * '' |
- | * '' | + | * '' |
- | * '' | + | * '' |
- | * '' | + | |
Next create your own '' | Next create your own '' | ||
Line 53: | Line 53: | ||
The twigstarter template comes with a '' | The twigstarter template comes with a '' | ||
- | You need to add your own styles after the included ones. | + | You need to add your own styles after the included ones. TwigStarter itself defines absolutely no styles on its own out of the box. |
===== Templating ===== | ===== Templating ===== | ||
Line 71: | Line 71: | ||
==== Layout ==== | ==== Layout ==== | ||
- | Twig supports [[https:// | + | Twig supports [[https:// |
* ''< | * ''< | ||
Line 106: | Line 106: | ||
</ | </ | ||
- | In addition, there is an object called '' | + | In addition, there is an object called '' |
Examples: | Examples: | ||
Line 121: | Line 121: | ||
Note: Twig escapes by default, when you call functions that return HTML you need to pass them through the '' | Note: Twig escapes by default, when you call functions that return HTML you need to pass them through the '' | ||
+ | |||
+ | ==== Custom Controller ==== | ||
+ | |||
+ | Usually you want some additional PHP code in your template. The easiest way to do so is to create class '' | ||
+ | |||
==== Caching and Debugging ==== | ==== Caching and Debugging ==== | ||
Line 126: | Line 131: | ||
Twig templates are compiled and cached. During development you don't want that. To disable caching, simply enable the [[config: | Twig templates are compiled and cached. During development you don't want that. To disable caching, simply enable the [[config: | ||
+ | ===== Templates based on TwigStarter ===== | ||
+ | |||
+ | Most templates that have been made with TwigStarter are not publically available as they have been built for clients at my dayjob. However below is (currently short) list of publically available template based on TwigStarter: | ||
+ | * [[template: | ||
template/twigstarter.txt · Last modified: 2023-01-10 18:49 by andi