View Issue Details

IDProjectCategoryView StatusLast Update
0018447phplist applicationTheme - Trevelinpublic03-01-17 22:40
Reporterduncanc 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.2.6 
Target VersionFixed in Version3.3.0 
Summary0018447: Theme naming problem
DescriptionWhen using the bootstrap theme in phplist by setting the $ui variable, that has to be called phplist-ui-bootstrap, the name of the git repository.

This is caused by the file pagetop.php, and possibly others, having a reference

<link rel="stylesheet" href="ui/phplist-ui-bootstrap/css/style.css?v=<?php echo filemtime(dirname(__FILE__).'/css/style.css'); ?>" />
TagsNo tags attached.

Activities

samtuke

16-12-16 11:37

administrator   ~0058542

Can these references be made relative? Would that impact child themes (e.g. boostrap-ph)?

mariez

16-12-16 14:07

developer   ~0058545

It was relative, but i changed answering Michiel request.
Ref: https://mantis.phplist.org/view.php?id=18370

mariez

16-12-16 14:09

developer   ~0058546

Also, the ph theme has php includes from public theme, and use LESS files from public theme, those references need to be hardcoded.

mariez

16-12-16 14:21

developer   ~0058547

Maybe we can use relative for bootstrap and hardcode for bootstrap-ph, if Michiel agree.

michiel

17-12-16 17:27

manager   ~0058557


We should split between the Name of a theme and the underlying folder structure. We can also not name the theme "bootstrap" because that's a reserved name. Boostrap is framework, but not a theme name.

We should be more creative with Theme names, eg https://en-gb.wordpress.org/themes/

I propose to give it a real name, eg "Chubut" or something. We can then have a little "meta file" like in the languages, that handles the underlying structure, eg

---
name=Chubut
folder=phplist-ui-bootstrap
---

And I will make a theme changer to allow swapping themes.

mariez

18-12-16 23:37

developer   ~0058561

Chubut! Yes! Trevelin is in Chubut!

mariez

20-12-16 22:35

developer   ~0058566

Reminder sent to: samtuke

Sam, do you want to assign this to me so i can change phplist-ui-bootstrap to "phplist-ui-bootlist" as we talk on last team meeting, or I should wait?

samtuke

21-12-16 09:59

administrator   ~0058567

Please work on this issue Marie. Thanks for the reminder.

mariez

22-12-16 01:21

developer   ~0058570

I created a theme_info file with 2 vars:
name=Bootlist
dir=phplist-ui-bootlist
I added a function in functions.php named theme_info to manage this and create relative paths to the ui/dir
I changed paths in footers, headers and pagetops to use this theme_info function.
So with this change you can change the theme directory and declare that name as dir in this theme_info file. And that should work.
I commited to my fork and made a PR, when you accept this change you should cnage the repository name to phplist-ui-bootlist, and the theme directory name in dev sites.
https://github.com/phpList/phplist-ui-bootstrap/pull/27

I did all the necessary changes to handle this in Bootlist-ph.
But as it is a child theme, i need to use hard path in many places.
Same as in Bootlist, i commited to my fork and make the MR, when you accept this you should change repository name to phplist-ui-bootlist-ph and dev site theme directory.
https://gitlab.com/phpList/phplist-ui-bootstrap-ph/merge_requests/42

michiel

03-01-17 22:37

manager   ~0058584

I've added a theme switcher and this can be seen on the DEV site http://dev.phplist.com/lists/admin/?

It uses the "theme_info" file and expects "name" and "dir" for variables for now.

michiel

03-01-17 22:40

manager   ~0058585

Reminder sent to: samtuke


I will document how this works. Remind me about it, if I didn't do that in the next few days, which will be best, when it's still fresh.

Basically:

1. you can use the theme switcher in the templates
2. if there's one theme only, it will not show.
3. you can force a theme, with "?settheme=XXX" on the URL
4. If the theme is incorrect or not found, it will default back to the theme set in the config file (GLOBALS['ui'])
5. for a theme to show up, there needs to be a "theme_info" file