Writing a skin in CPSDefault

Revision: $Id$

Contents

skin directories:

skins:
  |-- cps_default    all needed skin for CPSDefault
  |-- cps_devel      skin for benchmarking or debuging
  |-- cps_images     images only no icons
  `-- cps_styles     a plone_styles folder
      `-- nuxeo      a customization of the plone.css

skin order:

  1. (cps_devel)
  2. cps_styles/nuxeo
  3. cps_styles
  4. cps_images
  5. cps_default

1   File naming

We try to use the same file naming as CMF.

For any new file follow these rules:

  1. For a page template or a python script that return an HTML page:

    object_action.p[ty]
    

    If the page is a form: object_action_form.p[ty].

    Examples:

    content_submit_form.pt
    content_create.py       # use request and redirect to html page
    dummy_view.pt
    
  2. Python script:

    getSomething.py
    doSomething.py
    

    Examples:

    getContentInfo.py
    getFolderContents.py
    

    Note: It is very useful to make each python script work with a default value so that you can call them with a browser and you can bench mark it easily (cf. doc HOWTO.BENCHMARK).

  3. macro library:

    object_lib.pt
    

2   Generic names

folder:
a folderish object
content:
what is inside a folder
items:
a list of objects
proxy:
the cps proxy object
doc:
a cps document in the portal_repository
info:
a dictionary of information about an object
..path:
a list of item that represent a path like physical path
..url:
a /string/like/this that resolve

3   Python Script

mandatory header:

##parameters=only_ids=0
# $Id$
""" A description of what the script does, param and return if
it is not obvious """

Do not use context.REQUEST in a python script! You should pass it through the parameter line. Examples:

##parameters=REQUEST

or:

REQUEST=None``.

4   Path and URL

Follow CPSCore/doc/virtual-hosting.txt documentation to see all the ways to get url/path information about an object that will not break using virtual hosting.

main_template defines:

5   SVN

Follow these guidelines:

The following section of the SVN manual is helpful: http://svnbook.red-bean.com/en/1.1/svn-book.html#svn-ch-3-sect-5.

6   Macros

We try to use macros for any thing that appears twice or that needs to be easily customized. Macros are defined in a *_lib.pt file, for example content_lib or generic_lib. You should provide a test suite for each library. These are located in cps_devel like test_content_lib or test_generic_lib. Each time you add a macro you should add a test.

7   About CSS

XXX deprecated

8   Customization

We should be able to make light customization by adding custom CSS. We should be able to make heavy customization by rewriting *_lib files and maybe main_template. The goal is to keep all other files unchanged.

9   Translation and caveats

See howto-i18n.txt|html for internationalization and translation rules.

A skin is finished only when it is fully i18n and l10n in en and fr!