============
Local themes
============

:Revision: $Id: local-themes.txt 31277 2006-01-03 16:36:45Z dkuhlman $

.. sectnum::    :depth: 4
.. contents::   :depth: 4


Explanation
===========

Local theme names are obtained from folder attributes, i.e.

- as the property of a folder (one theme per line)

- as an object located in the folder that is callable and that
  returns a tuple.

Local themes are computed by collecting all theme information from
the portal to the context folder.

The format for describing themes is:

- simply a string containing the theme id.

- 'n-m:theme'

Where:

- 'theme' is the theme id

- (n, m) is a couple with n <= m that describes the interval inside which
  the theme will be used::

    (0, 0) means the current folder and all subfolders

    (1, 0) means all subfolders below the current folder

    (1, 1) means the subfolders of level 1

    (0, 1) means the folder and the subfolders of level 1

    (n, n) means the subfolders of level n
    ...

Examples
========

- With a folder property called '.cpsskins_theme':

- Lines with intervals::

    0-1:theme1
    2-4:theme2
    6-0:theme3

- String with interval::

    0-1:theme1

- String without interval::

    theme1

- With a script called '.cpsskins_theme.py' placed in a folder:

- Tuple with intervals::

    return ('0-1:theme1', '2-4:theme2', '6-0:theme3')

- String with interval::

    return '0-1:theme'


Specifying the Page
===================

To select the page of a theme, add '+page' to the theme name where
'page' is the page's name.

- Example::

    0-1:theme1+green
    2-4:theme2+red
    6-0:theme3+blue


.. Emacs
.. Local Variables:
.. mode: rst
.. End:
.. Vim
.. vim: set filetype=rst:

