How do I make my own theme?

Neil Girardi
Neil Girardi's picture

Joined: 2009-07-22
Posts: 64
Posted: Wed, 2009-08-05 19:38

I read the following tutorial, but apparently the author never finished it:

http://codex.gallery2.org/Gallery2:Themes:How_to_Create_a_New_Theme

The tutorial ends abruptly after explaining how to make the theme.inc. I initially tried to edit the Matrix theme but I was only able to get so far with that methodology. The CSS sheet is kind of a mess and I don't design in tables. When I found the link to the article above I decided to make my own HTML / CSS "mock-up" and then convert that into my own theme. After putting two very long days to get my mock up exactly the way I wanted it, I began with the tutorial today. Now I'm back at square 1 B/C the article is incomplete. I have a pretty decent foundation in PHP and I started converting my mockup to smarty .tpl files. However, I don't completely understand all of the logic statements regarding "blocks" and looping through thumbnail arrays. I don't know how to get those scripts and functions to integrate with my divs so that it comes out looking like my mock-up. I've been working on this for weeks and I'm so upset I feel like I'm going to vomit.

Neil Girardi

www.CenterfoldNextDoor.com

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Wed, 2009-08-05 20:07

You might want to take a look at existing themes and copy one
http://codex.gallery2.org/Gallery2:Themes:How_to_Copy_an_Existing_Theme

Or just edit one:
http://codex.gallery2.org/Gallery2:Themes:How_to_Edit_an_Existing_Theme

I believe that tutorial you're referring to would be for starting from scratch. The theme system in G2, which very flexible, is very complicated if you want to do much more than minor tweaks or visual changes.

G3's system should be much, much easier to deal with.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
Neil Girardi
Neil Girardi's picture

Joined: 2009-07-22
Posts: 64
Posted: Wed, 2009-08-05 22:15

Yeah, you're right... I just hate that that puts me right back where I started, using the Firefox Developer's tool to try and figure out what element to target, only to find that it's 3 different div classes combined, one of which is on line 25 of the style sheet, the second of which is on line 578, and the third of which isn't even listed. lol. And then of course none of the class or ID names are clear and there's like 200 of them. Plus there's no consistent naming convention (some are camel-cased, some aren't, some have spaces, some don't, etc.)

Well.. at least now that I've successfully executed the mock-up I don't have to play detective AND write new CSS at the same time. lol. Okay, I'll stop whining. It is a very impressive product!

Neil Girardi
www.CenterfoldNextDoor.com

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Wed, 2009-08-05 22:47

Check out Firebug www.getfirebug.com

As for the naming convention, that really depends on which theme are you starting with. I believe, (don't take my word for it) that Matrix, Floatrix and Classic are pretty consistent. Others... and some 3rd party themes are terrible in this regard.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here