Announcement

  •  » Engine
  •  » [evolution] Management of the template/theme

#16 2010-02-23 13:08:22

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Re: [evolution] Management of the template/theme

Here comes my reply to ddtddt.

I like the idea to move the "theme" directory from "template/yoga" for example. I would even say that we should move it at the root of Piwigo, not inside "template". What should we do with grum dark II, should it be renammed? I think this is the only case with the same theme name in 2 distincts templates (gally and yoga). In my opinion, it's wrong to think the same theme can be used in 2 distinct templates. Not with the current architecture of a template.

At piwigo.org/ext level, separate themes and templates, why not. In my previous post, I propose another way to do it: a theme may include its template. And a template can only be distributed with 1 theme, its basic theme. Your proposition is obviously cleaner BUT at piwigo.org/ext level, it means a new category with 3 or 4 items inside and only 3 or 4 people looking into (saimon, grum and flop25). Installing a template is not useful by itself.

The rule 1 theme in 1 extension is more or less mandatory whatever the architecture we choose. This is the end of theme packs like [extension by Swan] Boréalis (6 themes), [extension by flop25] Pack_blue ( for floPure) (3 themes) or [extension by flop25] Pack D1 ( for floPure ) (2 themes).

Offline

 

#17 2010-02-23 13:25:31

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Re: [evolution] Management of the template/theme

I also had a short discussion with P@t on the subject.

P@t thinks the "1 theme may include its template" is better than separating themes and templates in piwigo.org/ext.

P@t agrees that sharing a theme between 2 templates is useless. It's already complicated to make a theme work, no need to try to make a theme work with 2 templates.

P@t thinks that a distributed theme should include the correct directory tree. For example, in KoffeeTux_1.0.6.zip we should find template/yoga/theme/KoffeeTux and not only KoffeeTux.

P@t reminds me that installation by hand must remain possible.

Offline

 

#18 2010-02-23 22:10:38

grum
Former Piwigo Team
Pantin
2007-09-10
1371

Re: [evolution] Management of the template/theme

plg wrote:

I've had a private discussion with ddtddt related to this topic. Here comes his email (this was written by ddtddt, not me):

Ok.
But for an easier lisibility, I keep the "plg" quote... ;)

plg wrote:

1) Prerequisites

Users don't need to know about templates. They are just interested in themes.

I'm not completely agree.
A user take a look on the http://template.piwigo.net/ and fall in love with a specific template/theme. The user thinks "Hey ! This is exactly what I want".
But this is because the user don't know the difference between a template and a theme that we have to made is live easier, by "hiding" him the template/theme mechanism through an interface in the admin part, allowing to choose the good template/theme.


plg wrote:

2) piwigo.org/ext the place where we share Piwigo extensions

On piwigo.org/ext, we should separate "themes" and "templates"

In a perfect world, yes.
In my world, it can be.
If you take a look on the Gally template, you can see that each theme have a config file. The config file is used by the template.

And if I made some updates on the Gally template, you are sure that you need to update the Gally's themes. (I'm not able to explain why in english, and I'm not sure this topic is the the good place to talk about that)
In this case it seems it will be harder for a user to maintain is gallery if themes and templates are separated.


Another solution is to made a template-theme, where template & theme are fusionned
- Gally-grum-dark
- Gally-graphite
- Gally-lapis-lazuli
But I think it's not a good way :
- if I want to update the template for all my theme, I have to update 3 templates...
- making a new theme probably will be harder for newbies


plg wrote:

3) Architecture inside Piwigo

Inside Piwigo, we should move the "theme" directory into "template" (a theme may work on several templates)

Code:

template
  |_ yoga
  |_ template2
  |_ template3
  |_ themes
      |_ sylvia
      |_ clear
      |_ ...

In the themeconf.inc.php file (or another one) we should add data to identify the them

A theme can't work with several templates in all case.
Just try to apply the Gally themes on an another template. Or try to apply a Yoga theme with Gally. Nothing will works.



I don't have enough time to give solutions and translate them in english (wow, 1h30 to write this... english is not easy to speak.... ^^;)

We keep the actual tree :

Code:

template
  |_ yoga
    |_ themes
        |_ sylvia
        |_ clear
  |_ template2
    |_ themes
        |_ theme 1
        |_ theme 2
        |_ theme 3
  |_ template3
      |_ ...

In PEM, we can have :
- template+themes package s
- themes packages (a theme can be associated with one or more templates)

In the admin part, we have a list, ordered by template name/theme name
The admin choose wich theme have to be downloaded => if the theme is inside a package, all the package is loaded.

After, only selected template/theme selected can be used, even if a template/theme exists in the template directory.

If the user loads template/theme manually, he have to select them in the admin part to activate them.


My pictures with Piwigo, of course !
[ www.grum.fr ]

Offline

 

#19 2010-02-24 15:36:22

saimon
Member
2006-12-04
184

Re: [evolution] Management of the template/theme

« a theme may work on several templates » : it's not obvious for all the templates ;-).

IMHO, the distinction between template and theme makes confusion for the users, and it would be great to merge it and to provide an inheritance system for tpl files. A theme should be simply a declinaison of a template (mostly colors).
If I compare with dotclear (see screenshots below, and try it I you have some time, their administration panel is great ;-)):
- a dc theme is like pwg template
- there is predefined styles (equivalent to pwg theme) or customization possibility
- a theme can inherit from the default theme (by default) or from a particular one. Thus I you don't put picture.tpl in your theme, the picture.tpl from default/other theme is used. It makes it easier to make a derivated theme with some customizations.
- plugins provide their default html, which can be overridden by the theme

Offline

 

#20 2010-02-24 20:45:03

nicolas
Former Piwigo Team
2004-12-30
1232

Re: [evolution] Management of the template/theme

@saimon : I like you.

plg, any remarks about wordpress ? :-)

Offline

 

#21 2010-03-10 15:53:07

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Re: [evolution] Management of the template/theme

saimon wrote:

« a theme may work on several templates » : it's not obvious for all the templates ;-).

It may become more possible with template modeling. Template modeling is the inheritance you describe. Template modeling is for Piwigo 2.1 (very soon).

saimon wrote:

IMHO, the distinction between template and theme makes confusion for the users, and it would be great to merge it and to provide an inheritance system for tpl files. A theme should be simply a declinaison of a template (mostly colors).

Oh, yes, from this point of view, now with template modeling, we should really wonder if keeping 2 levels template + theme is relevant.

Does Dotclear proposes a multiple level of inheritance? for example, could simple/white be inherited from simple/grey, itself inherited from yoga/clear (most basic theme currently). You can tell me to search by myself :-) but if you already have the answer and your opinion about this it would be interesting.

saimon wrote:

If I compare with dotclear (see screenshots below, and try it I you have some time, their administration panel is great ;-)):

Yes, I look a dotclear administration panel and also Wordpress administration panel. They are really nice (slightly better for Wordpress, but not on everything).

saimon wrote:

- plugins provide their default html, which can be overridden by the theme

OK, very interesting.

Thank you very much for this post saimon (and sorry for my late reply, I had read it as soon as you wrote it, my answer was just... missing)

Offline

 

#22 2010-03-10 16:07:29

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Re: [evolution] Management of the template/theme

nicolas wrote:

@saimon : I like you.

I also do.

nicolas wrote:

plg, any remarks about wordpress ? :-)

OK... but only because you're asking :-D

Just one word about Dotclear : I stayed for 1 or 2 minutes before finding the "Theme manager" because I was only looking at the left menu and the "Blog aspect" is only on administration dashboard. Confusing. Another word : Dotclear doesn't directly connects to their theme repository, they really should if they find time for coding this, that's so much more comfortable for users.

What about Wordpress?

1 clic on the Administration>Appearance menu link, and you're in the Theme Manager.
Next to Theme Manager title, you have a button Add New
Then you have a guided search form to find the theme matching your need.

I don't know the internal mechanism for themes in Wordpress. All I see is that they have a huge database of themes. This means that their solution is easy enough.

Offline

 

#23 2010-03-10 22:02:19

saimon
Member
2006-12-04
184

Re: [evolution] Management of the template/theme

plg wrote:

It may become more possible with template modeling. Template modeling is the inheritance you describe. Template modeling is for Piwigo 2.1 (very soon).

great !

plg wrote:

Does Dotclear proposes a multiple level of inheritance? for example, could simple/white be inherited from simple/grey, itself inherited from yoga/clear (most basic theme currently).

yes (if I understand well): http://fr.dotclear.org/documentation/2. … nheritance

plg wrote:

Just one word about Dotclear : I stayed for 1 or 2 minutes before finding the "Theme manager" because I was only looking at the left menu and the "Blog aspect" is only on administration dashboard. Confusing.

you're right. It's something that should be improved with the results of their study on the ergonomy of the admin panel:
http://fr.dotclear.org/blog/post/2010/0 … -de-cartes
(interesting lecture for you as you are working on piwigo's admin panel ;-))

plg wrote:

Another word : Dotclear doesn't directly connects to their theme repository, they really should if they find time for coding this, that's so much more comfortable for users.

right too, but it's possible to install a zip file directly with its url.

Offline

 

#24 2010-03-11 00:03:08

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Re: [evolution] Management of the template/theme

saimon wrote:

yes (if I understand well): http://fr.dotclear.org/documentation/2. … nheritance

No in fact (I read twice).

All themes derives from "default".
"themeA1" derives from "themeA"

Here is the situation, we have:

themes/default/tpl/home.html
themes/themeA/tpl/home.html

and no themes/themeA1/tpl/home.html => themeA1 will use themeA/tpl/home.tpl

Now imagine that themeA derives from theme0 and you have a themes/theme0/tpl/tags.tpl (and not tags.html in themeA and themeA1). In themeA1, you will use... themes/default/tpl/tags.html and not themes/theme0/tpl/tags.html. It's OK if you need to read this 3 or 4 times before understanding.

Conclusion: there is only 2 levels of inheritance, including "default". But I think it's ok 99% of the time, we don't need more.

saimon wrote:

(interesting lecture for you as you are working on piwigo's admin panel ;-))

Ok, I'll read it. You're right, I'm in the middle of administration panel improvements.


Anyway, the dotclear way of managing themes and templates is really nice. Thanks a lot for showing the direction mister saimon :-)

Offline

 

#25 2010-03-11 22:51:46

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Re: [evolution] Management of the template/theme

[Forum, topic 15778] New architecture for themes, Dotclear theme architecture for Piwigo

Offline

 

#26 2010-03-11 23:07:55

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Re: [evolution] Management of the template/theme

Once P@t Proof Of Concept (with Dotclear-like theme architecture) is validaed, or not, I will code the theme manager. (step by step)

Offline

 

#27 2010-03-15 14:27:29

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Re: [evolution] Management of the template/theme

[Bugtracker] ticket 1507 is the first step, installation from piwigo.org.ext

Offline

 

#28 2010-03-17 11:18:53

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Re: [evolution] Management of the template/theme

The theme manager is functionnal. There are some bugs remaining, but you can already play with it.

* I have added [extension by Piwigo Team] p0w0 and [extension by Piwigo Team] wipi for test purpose, you can install themes for piwigo.org
* ability to activate, deactivate, set as default, delete in the new "installed themes" screen

Currently, when you set a theme as default, all users with the previous default theme will be updated to the new theme.

If you deactivate the default theme, Piwigo choose another active theme at random.

Dependencies are not managed yet, ie you can install a child template and even activate it, even if the parent is not installed. That's in the TODO list.

I've set a fixed height to 300px for each list of themes (active, inactive, new). If you have more than 1 line, it makes the display ugly. That needs a fix (help appreciated on this point :-).

Offline

 

#29 2010-03-17 12:27:19

P@t
Piwigo Team
Nice
2007-06-13
4098

Re: [evolution] Management of the template/theme

plg wrote:

Currently, when you set a theme as default, all users with the previous default theme will be updated to the new theme.

This is weird, I don't like that. Only guest's theme must change...

PS: reallly good work for theme manager. Thanks!


P@t

Offline

 

#30 2010-03-17 12:57:43

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Re: [evolution] Management of the template/theme

P@t wrote:

plg wrote:

Currently, when you set a theme as default, all users with the previous default theme will be updated to the new theme.

This is weird, I don't like that. Only guest's theme must change...

Let's talk about this specific issue on [Forum, topic 15624] changing the default theme and propagating the setting to all users :-)

Offline

 
  •  » Engine
  •  » [evolution] Management of the template/theme

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact