template:twigstarter
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
template:twigstarter [2019-05-25 09:57] – created andi | template:twigstarter [2023-01-10 18:49] (current) – version upped andi | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
---- template ---- | ---- template ---- | ||
Line 5: | Line 5: | ||
author | author | ||
email : andi@splitbrain.org | email : andi@splitbrain.org | ||
- | lastupdate_dt : 2019-05-24 | + | lastupdate_dt : 2022-09-30 |
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 |
- | bugtracker | + | bugtracker |
- | sourcerepo | + | sourcerepo |
donationurl | donationurl | ||
---- | ---- | ||
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 ====== | ||
- | There are two ways to use this template to create your own.You can either simply copy it and start customizing it, or you can copy only parts of it and make your template depend on the twigstarter template. In the latter case, user will need to install your template **and** the twigstarter template. | + | There are two ways to use this template to create your own.You can either simply copy it and start customizing it, or you can copy only parts of it and make your template depend on the twigstarter template. In the latter case, users will need to install your template **and** the twigstarter template. |
DokuWiki expects three files in a template directory: '' | DokuWiki expects three files in a template directory: '' | ||
- | Depending on what way you want to use there are different things to do: | + | |
+ | > There' | ||
+ | |||
+ | Depending on what way you want to use, there are different things to do: | ||
==== TwigStarter Copy ==== | ==== TwigStarter Copy ==== | ||
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. TwigStarter itself defines absolutely no styles on its own out of the box. | ||
===== Templating ===== | ===== Templating ===== | ||
Line 70: | Line 71: | ||
==== Layout ==== | ==== Layout ==== | ||
- | Twig supports [[https:// | + | Twig supports [[https:// |
* ''< | * ''< | ||
* contains the title, meta infos and favicon setup | * contains the title, meta infos and favicon setup | ||
- | * ''< | + | * '' |
* contains (nearly) everything | * contains (nearly) everything | ||
* has the '' | * has the '' | ||
Line 93: | Line 94: | ||
* The indexer webbug comes at the very end | * The indexer webbug comes at the very end | ||
- | This is not the most semantic setup, but it would be enough to create a basic template with styling alone. It should give you an easy starting point to create your own, more complex layout. | + | This is not the most semantic setup, but it would be enough to create a basic template with just styling alone. It should give you an easy starting point to create your own, more complex layout. |
==== Variables and Functions ==== | ==== Variables and Functions ==== | ||
Line 105: | Line 106: | ||
</ | </ | ||
- | In addition, there is an object called '' | + | In addition, there is an object called '' |
Examples: | Examples: | ||
Line 120: | 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 125: | 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.1558771059.txt.gz · Last modified: 2019-05-25 09:57 by andi