Themes Testing

2 views
Skip to first unread message

Robert Impey

unread,
Aug 24, 2010, 5:21:12 PM8/24/10
to Haddock CMS
I've added a site for testing development versions of reuseable themes
for Haddock CMS sites:

http://themes-testing.haddock-cms.com/

The idea behind themes is to separate the "look" of a site from its
functionality in a way that is reuseable. The only theme that I've
developed so far is the "Sky" (sorry Richard Murdoch, http://twitter.com/eliotbeer)
theme. I have ideas for more but no time.

The advantage of using a theme are software reuse and greater testing.
If you want want to contribute a theme and get a little exposure for
your work, please post here.

Saul Howard

unread,
Aug 24, 2010, 11:49:37 PM8/24/10
to Haddock CMS
On Aug 25, 4:21 am, Robert Impey <robert.im...@gmail.com> wrote:
> I've added a site for testing development versions of reuseable themes
> for Haddock CMS sites:

This is certainly interesting. However, I can't think of any two sites
I've developed with Haddock that have enough common html structure and
css to allow me to abstract a theme out of them.

Perhaps I am not the target for re-usable themes (they will certainly
be useful for some), but it does make me think I could use some lower
level building blocks for theme creation more than I could use the
actual themes themselves.

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.

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?

Robert Impey

unread,
Aug 25, 2010, 2:50:44 AM8/25/10
to haddo...@googlegroups.com
On 25 August 2010 04:49, Saul Howard <saulh...@gmail.com> wrote:
> On Aug 25, 4:21 am, Robert Impey <robert.im...@gmail.com> wrote:
>> I've added a site for testing development versions of reuseable themes
>> for Haddock CMS sites:
>
> This is certainly interesting. However, I can't think of any two sites
> I've developed with Haddock that have enough common html structure and
> css to allow  me to abstract a theme out of them.
>
> Perhaps I am not the target for re-usable themes (they will certainly
> be useful for some), but it does make me think I could use some lower
> level building blocks for theme creation more than I could use the
> actual themes themselves.
>

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

https://haddock-cms.googlecode.com/svn/plug-ins/public-html/trunk/classes/pages/css/PublicHTML_CascadingStyleSheet.inc.php

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

Reply all
Reply to author
Forward
0 new messages