Theming system

crischan

Joined: 2005-09-13
Posts: 3
Posted: Tue, 2005-09-13 19:26

Hi gallery folks!
I have just installed the stable release of gallery and started to get into theming to blend it inot my website design. I enjoy the Smarty way of things for theming, but have come unhappy about the template distribution in the gallery file tree.
I can not quite understand why not all templates can be overridden by template files somewhere in the active theme. It’s good that all templates can be overridden by a copy in the “local

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Tue, 2005-09-13 19:39

There's still some polish that needs to be done, but you can include those templates in your theme if you want. A G2 developer is working on this template override but there are some hurdles to overcome, like versioning. I excpect we'll see this abililty with the next release of G2.

For the time being, copy the template to your theme and include it with
{g->theme include="BreadCrumb.tpl"} (for example)

 
RwD
RwD's picture

Joined: 2005-01-09
Posts: 383
Posted: Wed, 2005-09-14 08:41

crischan, Just a comment on your view of the breadcrumb as an unordered list. I do not think you should put the breadcrumb into an ul because it isn't a list at all, it is a path (with links) where each link does have its own place inside a hierarchy but not in the breadcrumb.

Also, the current theming system makes you in control of the html a lot and doesn't specifically allow you to choose the css (Could be changed with the inc file I guess). But standard it doesn't really make sense to try to make html code that works with every css because every theme has it's own code+css. (I am seriously thinking about putting in some table elements at the wrong places in my own theme so it will just display right. I have an overflow problem that comes from a shortcomming in the css specs and tables will fix it visually. (So I will definately not be using multiple css'es with the same templates))

Nivekiam, Damn, I didn't know I could do it that way :P

 
crischan

Joined: 2005-09-13
Posts: 3
Posted: Wed, 2005-09-14 11:52

You're right that the breadcrum should not be an unordered list semantically. I will switch to ordered lists. This ordered list will display links to each node in the path trough the album tree which is a ordered list...
Thanks for the comments.

 
RwD
RwD's picture

Joined: 2005-01-09
Posts: 383
Posted: Wed, 2005-09-14 13:10

hmmz, a breadcrumb is not a list at all. Let me explain it in code:

<ol>
    <li>Gallery</li>
    <li>Album</li>
    <li>Subalbum</li>
    <li>Destination</li>
</ol>

This is what I think you are sugesting, ordering breadcrumb elements as a summation in a list. But when you look at the standard display of an ordered list you know that this display is "wrong" because of the relation between each item. eg, each item is the child of the preceding item.

This display would be correct where these menu items which basically are a random summation of possible options a user has to visit.

So semantically correct would be:

<ol>
    <li>Gallery
    <ol>
        <li>Album
        <ol>
            <li>Subalbum
            <ol>
            	<li>Destination</li>
            </ol></li>
        </ol></li>
    </ol></li>
</ol>

But that is I think very hard to make using smarty and there can also be a less complex interpretation of the items in a breadcrumb...

The less complex interpretation is the one currently used in gallery:

<div class="breadCrumb">
    <a>Gallery</a>
    <a>Album</a>
    <a>Subalbum</a>
    <a>Destination</a>
</div>

I don't have the words for the explanation I should give, but using the last method makes a lot more sense.

 
crischan

Joined: 2005-09-13
Posts: 3
Posted: Thu, 2005-09-15 08:33

Well, I don't want to argue with you, maybe there is more than one valid view on this. For me I remember my algebraic geometry class where I learned that a path trough a (two-dimensional) tree has one dimension and thus has no or only a ordered list hierarchy.
So why I view the breadcrumb as a path, you see it as a subset of a tree. Both views are valid, how about that?

 
RwD
RwD's picture

Joined: 2005-01-09
Posts: 383
Posted: Thu, 2005-09-15 09:55

I hated algebraic geometry :P