Announcement

#1 2012-09-23 11:40:16

hhm
Member
2012-09-23
2

Making my own theme, is there a list of the variables?

I'm considering migrating to Piwigo. So I'm trying to create a new theme to get as close as possible to the design of my old site.

Is there a documentation about the variables and parameters?
Is there a documentation about the sequence in which the templates are being handled?

I found this http://piwigo.org/doc/doku.php?id=dev:theme_creation and this article http://piwigo.org/doc/doku.php?id=user_ … esentation even points to a dead link in the wiki called "configuration parameters", but that's about it.

Any help appreciated,
Hans

Offline

 

#2 2012-09-23 11:52:24

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3271

Re: Making my own theme, is there a list of the variables?

there is no such list but if I can give you an advice you should not create a theme from scratch
why ? because most of the plugins won't work, as they are dependant of the HTML structure

the good way is to create a child theme of "default" (look in themeconf.php file of other themes) add a custom theme.css file and ONLY IF NEEDED duplicate the files of the "template" sub-folder and modify them

Offline

 

#3 2012-09-23 12:05:31

hhm
Member
2012-09-23
2

Re: Making my own theme, is there a list of the variables?

mistic100 wrote:

there is no such list but if I can give you an advice you should not create a theme from scratch
why ? because most of the plugins won't work, as they are dependant of the HTML structure

That's exactly what I'm trying to understand. I want to learn ho Piwigo works on the inside. If that's not possible due to insufficient information, this is a dead end for me and I can stop working on it.

mistic100 wrote:

the good way is to create a child theme of "default" (look in themeconf.php file of other themes) add a custom theme.css file and ONLY IF NEEDED duplicate the files of the "template" sub-folder and modify them

I don't even understand what a child theme is because there is no explanation what it is. Documentation of the project is scarce. There are a lot of themes to choose from, but none of them will suit me with just a few colour changes. I don't want every function the themes and templates offer. I'd rather write my own so I understand, what goes on on my server and get rid of the functions I'll never use, eg. user management.

Regards, Hans

Offline

 

#4 2012-09-23 12:14:09

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3271

Re: Making my own theme, is there a list of the variables?

you can do as I done before : read the code and try

I don't think you need to understand the deep engine of Piwigo to create a theme

the main lines are here http://piwigo.org/doc/doku.php?id=dev:theme_creation

- when a a theme is selected Piwigo starts to read it's themeconf.inc.php file
- if you set 'parent' => 'default' it will first load all 'default' theme files, including complete HTML structure and basic CSS
- you can overload CSS by adding a theme.css file in you theme folder
- you can overload HTML structure by adding files into the "template" subfolder

about templates, each part of the page corresponds to a distinct tpl file (I think names are clear: picture.tpl, menubar.tpl....)

if you create a theme which only needs some modifications on the picture page, your filestructure looks like

- theme folder
   - template
      - picture.tpl
   - theme.css
   - themeconf.inc.php
   - screenshot.png

Offline

 

#5 2013-05-11 23:12:56

Nick
Guest

Re: Making my own theme, is there a list of the variables?

Hi so sorry to bump this and interupt here, but i cant seem to get on this link says "Page hasn't been created yet" ... Is there anywhere else i can look?

 

#6 2013-05-11 23:21:17

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3271

Re: Making my own theme, is there a list of the variables?

just do a quick search in the wiki.....
http://piwigo.org/doc/doku.php?id=dev:e … e_creation

Offline

 

#7 2014-03-12 06:48:28

Hamish
Guest

Re: Making my own theme, is there a list of the variables?

I just spent an hour looking for a variable or function that can tell is a user is logged in or not.

I found this function,

is_a_guest();

Basic variables/functions like this should be documented.

 

#8 2014-03-12 08:25:34

flop25
Piwigo Team
2006-07-06
6918

Re: Making my own theme, is there a list of the variables?

Hamish wrote:

I just spent an hour looking for a variable or function that can tell is a user is logged in or not.

I found this function,

is_a_guest();

Basic variables/functions like this should be documented.

Well a basic doc for non dev should first be written. But you might see that we are commenting Php functions to then run a script which will build a doc from these comments


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2019 · Contact