Difference between revisions of "Templates"

From AV Scripts Wiki
Jump to: navigation, search
(Getting Started)
Line 4: Line 4:
  
 
If you are not familiar with the Twig template engine then your first step is to learn the basics by reading the [http://twig.sensiolabs.org/documentation Twig documentation].
 
If you are not familiar with the Twig template engine then your first step is to learn the basics by reading the [http://twig.sensiolabs.org/documentation Twig documentation].
 +
 +
Next you will want to enable [[Developer Mode]] so that the changes you make during development are instantly reflected. If you are not in developer mode, you will need to refresh the caches in the admin panel every time you modify a template file.
  
 
== Overriding Templates and Assets ==
 
== Overriding Templates and Assets ==

Revision as of 10:22, 25 March 2015

Templates in AVCMS are built using the Twig template engine.

Getting Started

If you are not familiar with the Twig template engine then your first step is to learn the basics by reading the Twig documentation.

Next you will want to enable Developer Mode so that the changes you make during development are instantly reflected. If you are not in developer mode, you will need to refresh the caches in the admin panel every time you modify a template file.

Overriding Templates and Assets

The only template required in your theme is the index.twig file. But if you want to change the layout of other pages beyond what you are able to do with CSS, you can override them. You can also override default CSS and Javascript files. Remember, the more files you override, the more work you need to do when AVCMS is updated and changes are made.

The first step to overriding a file is finding out the name and location of the file you want to overwrite. When in developer mode you can find the name of the current page template on the developer toolbar at the bottom of all pages.

Template Settings

You can create settings for your template that can be configured by admins in the AVCMS admin panel. For example you could have a setting that changes the background colour of the page or a setting that allows users to change the site logo.