[OPEN-ILS-DEV] The future of the craftsman skin

James Fournie james.fournie at gmail.com
Fri Aug 20 17:45:07 EDT 2010


Hi there, just wanted to weigh in on our experience with skins.

> IMO, the crux of the problem is that the rendering requirements of
> craftsman, being significantly higher than default, make it cost
> prohibitive for rapid development.  Your point about structure is a
> good one, but I think is a symptom as much as a cause.

This is spot on.   SITKA does not use the craftsman skin, this is
primarily because SITKA needs the be able to quickly customize skins.
Most of the time all we want to change is the logo and the colors,
which is quite burdensome in the craftsman skin without extensive
photoshop tinkering with tiny gradient images and transparency.  We
create one or two skins a month for newly migrated sites, and we need
to maintain now up to 39 skins.  These are stored in a git repository
which allows us to have master skins with which we can import changes
(ie: JS bugfixes) to the default skin upstream.

With respect to easing development of skins, I have made the following
changes to our base OPAC skin and they have greatly simplified things
to the point where we only really need to change a CSS file and an XML
file to get a completely new skin.  Note that BPR is the code for one
of our libraries Prince Rupert, which I use as an example:

1.  Move everything from
/openils/var/web/opac/theme/BPR/css/colors.css into the
/openils/var/web/opac/skin/SOMESKIN/css folder.  This also requires
updating opac/skin/BPR/xml/common/css_common.xml.  Basically, we
didn't find the 'theme' concept useful and it's much easier to keep
all the css files in once place.

2.  Standardized the logos into two files which have standardized
names: /openils/var/web/opac/skin/BPR/images/main_logo.jpg and
mini_logo.jpg.  Because they are in the skin's folder, we can store
them right in the git repository and easily update them.

3.  Used three more includes in setenv.xml as follows:

<!--#set var='OILS_SITE_NAME' value="Prince Rupert Public Library"-->
<!--#set var='OILS_HOMEPAGE' value="http://www.princerupertlibrary.ca/"-->
<!--#set var='OILS_SKIN_NAME' value="BPR"-->

The first two includes are standard parameters, basically I found we
needed to change them for every site.  They are the full name of the
library and the library's homepage, and are respectively the alt text
and href for the anchor around the logo image.

The third include is very useful as in numerous places there are
references to specific urls, for example in the file searchbar.xml
there is a line like this:

<script language='javascript' type='text/javascript' src='<!--#echo
var="OILS_OPAC_JS_HOST"-->/skin/default/js/search_bar.js'></script>

However, if we wanted to copy this skin and make a new skin, we would
need to search and replace for every instance of 'default', which can
be annoying.  Instead, we replaced it with this:

<script language='javascript' type='text/javascript' src='<!--#echo
var="OILS_OPAC_JS_HOST"-->/skin/<!--#echo
var="OILS_SKIN_NAME"-->/js/search_bar.js'></script>

Now just need to update the setenv.xml file when we clone a skin.

Anyway, that's all just thought I'd share.

~James Fournie
SITKA Team


More information about the Open-ils-dev mailing list