How difficult will it really be to customize the theme?

skunker

Joined: 2005-02-04
Posts: 344
Posted: Wed, 2009-09-02 15:24

I'm not a programmer, I'm mostly a designer. While I do know some basic CSS/XHTML/php, I don't think I feel too comfortable diving into G3's theme and changing the layout, etc.

So, how difficult will it really be for someone like me to make customizations to the theme?

Would some of the Gallery team be available for hire at some point? I had hired Floridave to do some edits for a custom theme a few years ago and he did an outstanding job (floridave, remember that ww2 theme you did?).

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Wed, 2009-09-02 15:39

If you know CSS and HTML that's going to be almost all you need to know. For the php, you could pretty much copy and paste.

Here's a tutorial on taking the default theme, copying it and starting from there: http://codex.gallery2.org/Gallery3:Tutorials:Themes

We're working on more extensive docs to better explain what the different files are for, css classes, etc, but that all takes time :)
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
cefm

Joined: 2009-06-21
Posts: 10
Posted: Thu, 2009-09-03 00:44

The .js makes it harder but not impossible. Definitely easier to me than G1, G2, or Drupal. Harder that WordPress from be but just because I don't jet how it works, or how to define where the change where modules get output. Gallery3 makes the mistake of Gallery2 by running large parts of code and CSS from the modules but that is me annoyance the major problem.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Thu, 2009-09-03 04:05

Most if not all CSS from modules can be overridden in the theme's CSS. If the module didn't output HTML and CSS then it would be up to the theme and theme developer to have CSS for every possible module under the sun.

Any module's xxxx.html.php page can be overridden in your theme by copying it to your views directory and customizing it.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
cefm

Joined: 2009-06-21
Posts: 10
Posted: Thu, 2009-09-03 09:51

how can you override a helper in a module like search to go to header_bottom rather that header_top, from the theme without editing the module file

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Thu, 2009-09-03 16:48

Here's what I'd do. I'm going to suggest a change to the team about this and see if they think it's a good idea anyway.

Take the search.html.php file from modules/search/views copy it to your theme. Edit it so that the search form is wrapped in a named div (which I think it should be anyway, personally) and then position and style it anyway you want.

Of course I could be approaching this wrong, as I'm not very knowledgeable about CSS and the right way to go about things :)
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Thu, 2009-09-03 16:50

And if that's not what you're looking for, then what are you trying to accomplish? We want to better understand what the people who are going to be hacking on themes need to do.

Thanks
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
Glooper

Joined: 2005-09-21
Posts: 225
Posted: Thu, 2009-09-03 19:25

I think he means getting it working in the same way as drupal works. A modules creates a block but doesn't define where it appears... it could appear in any of the header_bottom Header_top, photo_bottom... etc... The user can then position the module on the screen by choosing the area in which it will appear, in a separate block configuration page, where all the blocks that have been created by the various modules can be arranged in the various place holders around the screen.

It would be quite neat..:)

The themes developer can then define only the place holders he or she wishes to support.

Ben

Benjamin Albert Smith - Photography

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Thu, 2009-09-03 19:34
Quote:
The user can then position the module on the screen by choosing the area in which it will appear, in a separate block configuration page, where all the blocks that have been created by the various modules can be arranged in the various place holders around the screen.

That's coming, probably not in 3.0 though.

Here's what's been talked about so far:
http://codex.gallery2.org/Gallery3:Block_Management_UX

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
Glooper

Joined: 2005-09-21
Posts: 225
Posted: Thu, 2009-09-03 19:41
 
thumb
thumb's picture

Joined: 2004-05-26
Posts: 238
Posted: Thu, 2009-09-03 20:29

In regards to wrapping every module block in a div:

Typically this isn't necessary and just adds extra code. In the case of the search form, the unique CSS ID is applied to the form tag, whic is a block element. The only time you should need a div s when a module's block contains two separate items, like a paragraph and an item list. The div would go around them to group them as a single block.

Drupal's block naming convention is a bit overkill, IMO. I know it was designed as part of their block placement system, but I hope that G3's ID's aren't as complex.

Support the Gallery project with a donation
--
2tbsp.com

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Thu, 2009-09-03 21:21

Great! Thanks thumb. I saw that CSS ID, but didn't realize you could probably do anything one would need for that.

nivekiam wrote:
Of course I could be approaching this wrong, as I'm not very knowledgeable about CSS and the right way to go about things

:)

Ugly and crud, but an example (and probably a bad one at that, but these are my CSS hacking skills...)

.gShortForm {
  float: left;
  position: absolute;
}

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
cefm

Joined: 2009-06-21
Posts: 10
Posted: Thu, 2009-09-03 23:43

The issue is really I want "Logged in as xxx Logout at the top" but if i use header_top then I get search as well. What I am suggesting is that modules should have either a selector for the default output in admin, or in the theme info file. module-output-override('Search','photo_bottom) or a template can define a placement by choosing etc $theme->('module','search') and then not output in the default output.

My work in progress of a theme is at http://snapshots2.cefm.ca I'm trying to clone cefm.ca. It is based off the Eos theme from WordPress.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Thu, 2009-09-03 23:39

I'm no CSS expert, but the login menu is addressable like so:

#gLoginMenu {
  position: absolute;
  left: 200px;
  top: 10px;
}

Another bad example that's probably making thumb and all other UI people cringe :)
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
thumb
thumb's picture

Joined: 2004-05-26
Posts: 238
Posted: Fri, 2009-09-04 03:53

@cefm We have a pretty long list of things to do, but please know that what you're asking for is on "the list." What nivekiam suggests, or something close to it, should work.

Support the Gallery project with a donation
--
2tbsp.com

 
cefm

Joined: 2009-06-21
Posts: 10
Posted: Tue, 2009-09-08 01:38

I just tried something and it worked.

If you copy the helper file for a module into a folder called helper in your theme you can edit it for your theme only so that it doesn't effect your other themes. it doesn't just work for views apparently. This is what I was really looking for. Makes theming a million times easier. Possibly a good add to the Themes documentation.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Tue, 2009-09-08 02:03
Quote:
it doesn't just work for views apparently.

What do you mean? That's exactly what I described above and it works, I've done it.

Just copy it into your theme's views directory.

Good tip on the helpers. I'll have to look into if that's intended or an unknown side-effect. If it's intended I'll document it. If it's an unknown side-effect, I want to make sure it's not going to get "fixed" in the future :)
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
cefm

Joined: 2009-06-21
Posts: 10
Posted: Tue, 2009-09-08 02:18

It appears to be how the theme overrides work is it grabs all the modules then uses any document in a directory from the theme and overrides the module.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Tue, 2009-09-08 16:57

I just got confirmation. This is the intended behavior. A theme can override anything. This is a benefit of using the Kohana frame work with it's cascading file system.

I'll start working on the documentation for this.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here