nuxeo-widgets
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nuxeo-widgets] Proposal: skins


From: Juan David Ibáñez Palomar
Subject: [Nuxeo-widgets] Proposal: skins
Date: Fri, 15 Feb 2002 19:31:45 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.7) Gecko/20020203

Hi all, and welcome to the widgets mailing list,


Currently the product has some problems:

 - The look and feel out of the box is very ugly;

 - It's impossible to customize the look&feel in browsers
   without CSS support;

Actually the problem are some limits of Page Templates,
which I'm trying to work around.

The idea is to do a pre-processing of the template..


I'm going to introduce the concept of a "skin", as example I'll
use the calendar since it's more simple than the timetable.

A skin could be a mapping like this:

 {'calendar': {'border': '2'},
   'weekday': {'bgcolor': 'yellow'},
   'day': {'valign': 'top'}}

The keys of the skin (calendar, weekday and day) identify one
or more elements of the template.

The template file is processed and the selected skin is applied to
it to generate the new template, for example:

 <table skin="calendar">...</table>

becomes:

 <table border="2">...</table>

The template generated after the processing is the actual macro
used by the user. The user's code could look like this:

 <div tal:define="calendar_skin string:default">
   <div metal:use-macro="widgets/calendar">
     ..
   </div>
 </div>

Here "widgets/calendar" is a method, it:

 1. gets the "calendar" template from the filesystem;

 2. process it applying the skin, generating the new template;

 3. returns the macro "calendar" within the generated template.

The skin as specified by the user can be a mapping or a string, if it's
a string (as in the example) it selects a skin stored in the filesystem,
defined in the product, for example:

 skins = {}
 skins['default'] = {...}

If no skin is specified a default one is used. If the skin is None, the
element is removed.

This way it would be possible to:

- modify any attribute in the macro to completely customize it,
   even in browsers withouth CSS support;

- the default skin would provide a beatiful look&feel so the widget
  looks nice out of the box;

- it could be possible to create libraries of skins, as in Mozilla.


Well, what do you think?


--
J. David Ibáñez, Nuxeo.com
Debian user (http://www.debian.org)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]