new themes setup, customizing blocks/modules

jasonmac

Joined: 2005-06-15
Posts: 35
Posted: Wed, 2005-07-20 02:35

I have been playing with the new Themes structure in last night's build.

I like a lot of it (much better than the original), however I still have some issues. I am hoping these have been solved and I just haven't figured out the right way to handle these...

Basically, my problems come from the fact that I want to be able to easily distrubute my Theme...thus I find the idea of 'local' directories all over the place, umm, annoying. Everything I need to have the site look how I want - I should be able to put in my theme directory - end of story.

A Theme directory, simply put, should have full control of all of Gallery looks and layout.

1) colorpack...why another module? What used to be Theme/Layout is now Theme/Color! Why can't it default to looking for a color.css file in my themes directory? The way it is now, I have to distribute an extra directory (with just 1 file in it) - and then explain where to put it and all. Let it fall back to the colorpack for if users want to use other colors...but by default it should use color.css in the themes directory - if exists).

2) customizing blocks. I see that blocks use their .tpl file in core/templates/blocks. Is there some way to make it look somewhere else for certain blocks' layouts (without changing basic code...just changing stuff from within my theme directory)? I want to just have a blocks directory in my themes directory where I can override the default block layouts.

3) same idea with modules. They look in their directory for layouts...I want it to look in my directory by default. ???

Basically, a themes directory could look like this:

matrix\templates\ - the usual goodies
matrix\templates\blocks - gallery looks here first to find block tpl files
matrix\templates\modules\cart - for instance would have the cart tpl files

If a module doesn't have a tpl for some block or module...it falls back to the way it is now for it.

Maybe y'all have other ways of solving this...and I am missing it? Using local directories all over the place make distribution tough...instead of looking in local all over the place...just look in the current theme's directory.

I do hope I am just missing something.

Gallery is running and looking wonderful...keep up the good work. Thank you!

--
Jason

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2005-07-20 07:18
Quote:
Basically, my problems come from the fact that I want to be able to easily distrubute my Theme...thus I find the idea of 'local' directories all over the place, umm, annoying. Everything I need to have the site look how I want - I should be able to put in my theme directory - end of story.

that's perfectly possible.
it's not documented yet, but you can ship your theme with replacement/override template files for all templates.
e.g. if you want an override for modules/core/templates/blocks/ItemInfo.tpl in your theme (copy'n'paste from bharat on IRC):

Quote:
copy modules/core/template/blocks/ItemInfo.tpl to themes/matrix/templates/ItemInfo.tpl, then change ' {g->block type="core.ItemInfo" ' to ' {g->theme include="ItemInfo.tpl" ' to use your local copy. HOWEVER, that won't work until you get a minor change I just committed (which you can tweak by hand if you want)

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2005-07-20 07:25

1) Color packs are optional. no theme needs a colorpack. you can have colors etc. in your theme.css.
the idea behind the color packs was to not have to copy / maintain several copies of a theme just for different color styles. maybe you know the concept of websites where you can select your own color scheme. the color packs are for that or if you want different color schemes in different albums.

2) See my last post. Sooner or later you don't have to do this {g->theme include} stuff and it will automatically check in themes/themeName/templates/modules/*/* for overrides, but for now, you have to do what is described in my previous post.

3) Same answer. Maybe the current concept won't work here, but sooner or later there will be the option to put override templates in the theme dir structure.

The concept of local directories is for those, who wish to customize without creating a theme.

 
jasonmac

Joined: 2005-06-15
Posts: 35
Posted: Wed, 2005-07-20 14:51

excellent, sounds like y'all are on the way to doing what I was talking about...automatically checking in themes first. And if the hack you first posted works for now, that is just great...I will look at that later today.

As for colorpacks, I see what you mean now, letting the user change their color settings easily. Do they currently have access to this in their user preferences panel? I will look this afternoon.

Thanks for your help. As usual, it seems y'all have solved (or are solving) the problems I am having.

--
Jason

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2005-07-20 15:04

no, there's currently no color pack switch block. one could create such a block. at the moment, you can change this per album in edit album -> theme.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sun, 2005-07-24 20:44
valiant wrote:
that's perfectly possible.
it's not documented yet, but you can ship your theme with replacement/override template files for all templates.
e.g. if you want an override for modules/core/templates/blocks/ItemInfo.tpl in your theme (copy'n'paste from bharat on IRC):

valiant, I tried that with BreadCrumb.tpl the other day and the changes didn't seem to take. Even after clearing the template cache.

I tried putting it in /themes/matrix/ and /themes/matrix/templates/ and even /themes/matrix/templates/modules/core/templates/blocks/

None of which worked.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-07-24 21:00

nivekiam, you've noticed that you have to add an include statement in the g->block if you want to use your override, right?
sooner or later this won't be needed anymore, but for now you can't just put your version of the tpl in the themes directory.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sun, 2005-07-24 21:10

Sorry about that. I thought that was a quote from above and skipped over it. I see now. Thanks, it works great.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Mon, 2005-07-25 00:57

I split discussion of 3 digit color abbreviations to a new topic here, http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&t=33266