[Zope-PTK] CMF some basic Q

Jeffrey P Shell jeffrey@Digicool.com
Thu, 15 Mar 2001 22:22:54 -0500


on 3/15/01 8:41 PM, Bill Anderson at bill@libc.org wrote:

> On 15 Mar 2001 13:34:04 -0500, Jeffrey P Shell wrote:
>> On 3/15/01 2:54 AM, "Bill Anderson" <bill@libc.org> wrote:
>> 
>>> On a related note, is there any way short of a restart of Zoe to refresh
>>> the filesystem non-customized stylesheets?
>>> 
>>> The ones provided don't expose enough (select a black background and
>>> tell me how well your h[1-n] tags come out, for example ;) , and while
>>> building a new one, it sucks to have to restart my zope server to see
>>> the effect of moving a margin or two...
>>> 
>>> Bill
>> 
>> Why are you modifying the ones on the file system instead of through the web
>> in custom folders?  Whenever I'm doing any experimenting in skins, even in
>> something planned to go into the core distribution, I always do it in a
>> custom folder so I can see the effects quickly.  If it's something meant to
>> go into a distribution, I'll copy my changes to the file system after I've
>> tested them this way.
> 
> 
> Cuz you can't _just_ modify the few options provided, that's why. Much
> stuff is still hard-coded, and not accessible in the TTW customize
> option.  For example, the color of your the header tags is black.
> Period. Looking at the stylesheet from the FS, you can see it is
> hard-coded, by not providing an variable to be substituted. No variable,
> no TTW customization.
> 
> A few other things are needed occasionally, such as changing padding
> sizes, or margins. None of these are available TTW. Sure, I can change
> those and make variable for them, but that is -still- changing the file,
> and not using a customized instance TTW. It would still require a
> restart.

Which file are you referring to?  In generic/default_style_sheet.dtml, there
is:

h1 {
font-size: 120%;
font-weight: bold;
color: &dtml-base_font_color;;
}

If you want to change that color with skins, you can do it a couple of ways:

 (1) Go to portal_skins/generic/default_style_sheet (in the Zope Management
     Interface) and hit 'customize' to copy it into a custom folder.  Go
     down to the h1 declaration and change color by hand - not referring to
     any DTML variable.

 (2) Go to portal_skins/generic/stylesheet_properties in the ZMI and do
     a 'customize' on it.  Find the property for 'base_font_color' and
     change the property to reflect your desired color.

 (c) Do both!  The stylesheet_properties are just an attempt to give
     some convenience over having to write\edit stylesheet code just
     to change a color, but you should be able to extend the
     customized style sheet to either accept more properties or have your
     own hardcoded values.

As long as your skin is set up correctly (with 'custom' - or any other
customized folder in the 'portal_skins' tool - having precedence over
'generic'), the above should work without you needing to access the files.
Part of the reasoning for the design behind Skins is to solve the ZClass
distribution problem, where it was easy to import the DemoPortal ZClass and
start editing the DTML Methods to customize the look for one's site.  The
problem with that was that when we released an upgrade, there was no way to
easily merge changes.  With skins, it allows us to distribute the default
look and feel in a way that should discourage tinkering with the original
sources (the file system DTML), but encourage easy customization by letting
the source from the file system be easily copied to a folder in the skins
tool which would get name-lookup-precedence over the file system folders.
*ALL* of the DTML that is in the file system should customizable through the
web.  If this isn't working, it is either a bug in our code, or my fault for
not completing my documentation task. :)

I'm going to be out for a couple of days (one final ski weekend, hazzah!),
but I hope this message helps or someone else on the team can help.

Otherwise, I too would recommend Zope's 'debug' mode - it's useful when
doing active development work on a site with file system DTML.

--
Jeffrey P Shell, jeffrey@Digicool.com
http://www.zope.org/ | http://www.digicool.com/