Making new skins
Introduction
Making new skins is easy, although you do need to know how to write
HTML. In Alive CMS skins basically consist of two template types plus
supporting files like images and CSS. The skins live in the 'templates' folder of your application. Inside that folder you find a folder with the name of a skin that contains all you need for using that skin, or at least it should contain everything that is needed.
Skins and how to make them
So these are the two template types:
- The Master template. This template contains the header, the menu and the footer plus a space where the actual content of the page is inserted
- The Content type template. This template allows you to fine tune how the content is displayed. For simple content type (like Page) the template in the default skin is all you need. But when you are building a new content type you usually have to provide a 'view_item.html' and an 'edit_item.html' template
When making a new skin consider these gotchas:
- Skins live in application folder's templates. There are a few already there and the default_skin must be there, otherwise Alive CMS very likely breaks. Note the the default_skin is a link which has the effect that it is a shared skin between all you applications in your Alive CMS Django project.
- A new skin needs to meet a few minimum requirements:
- A layout, the layout is the master template that together with the associated CSS defines the look & feel. The layout lives in:
'templates/<your_skin>/layouts/layout.html'
- Optional, a directory with image files
- Optional, a directory with CSS files
- You can have templates for each content type but that is optional as long as the default skin has a corresponding template. Alive CMS first looks for a content type template in the skin you have set for the site and if it doesn't exist it looks in the default skin for the corresponding content type template and if that fails it looks for a generic view_item template. Templates for content types live in the 'content_types' folder of the skin, for each content type there is a sub directory in the content types folder with the name of the content type, which has the templates in them. Usually you need 'view_item.html' and 'edit_item.html'
Layout example
Template example