A theme doesn't have to be a fully developed site. It could be as
simple as 'three column layout'. All the details could be provided by
the project-specific code.
> I think one problem is lack of a css generator. I'm not a believer in
> css frameworks, but I certainly regret the lack of css reuse in my
> haddock projects. To enable reuse you would need to have a css
> generator program (to insert variables, for example), I have heard of
> SASS for, I think, Ruby, but not looked into it.
>
> A quick google turns up these:
>
> http://sass-lang.com/ - Ruby
> http://xcss.antpaw.org/ - PHP
> http://lesscss.org/ - Ruby again
>
> I think the reason these exist is that, while every designer would
> like more powerful features in css (functions, classes, variables),
> they never find that they could abstract it away completely. Each
> site's design does have to be tinkered with on the HTML/CSS level, any
> higher than that (selectable themes, for example) would be an
> abstraction too far.
>
There's already a class for generating CSS at
Unfortunately, this is only in the plug-in version of the Public HTML
module. We should probably do some merging.
> Something useful for theme creation I do find myself needing in
> styling projects at the moment is HTML5. With a JS library like
> modernizr for backwards compatibility, there's no reason to be using
> HTML4. Converting Haddock to HTML5 will make theme creation far
> easier. With HTML5, which gets rid of so much of the <div><div><div>
> structure we're used to, there's much more scope for a standard
> Haddock HTML layout that can be styled by any css without needing to
> alter it. This upgrade to Haddock would be very simple, just a matter
> of changing PublicHTML_HTMLPage I think?
>
This might be more safely handled by a theme. By using a modernizr
theme, we could reuse code.
I can see us getting into problems with multiple inheritance. The
themes currently use inheritance. If you want to use the 'Foo' theme
in your project, make 'MyProject_HTMLPage' extend 'FooTheme_HTMLPage'.
This means we can't use the 'Bar' theme. Perhaps some sort of object
composition:
http://en.wikipedia.org/wiki/Object_composition
would be a better design. So we would write:
class MyProject_HTMLPage extends Themes_HTMLPage
{
protected function get_themes()
{
$themes = array();
$themes[] = new FooTheme_FooTheme();
$themes[] new BarTheme_BarTheme();
return $themes;
}
}
Themes_HTMLPage would extend PublicHTML_HTMLPage and would contain an
abstract function called 'get_themes()'. This would be called in
Themes_HTMLPage::apply_themes(). This way, a site could use lots of
themes simultaneously.
Perhaps this is beyond the idea of a theme.
> --
> You received this message because you are subscribed to the Google Groups "Haddock CMS" group.
> To post to this group, send email to haddo...@googlegroups.com.
> To unsubscribe from this group, send email to haddock-cms...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/haddock-cms?hl=en.
>
>
--
Rob Impey