Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2016-01-13 14:32:21

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Admin theme selecting

Hi,

I’m testing out a preliminary build of a second colour scheme version of Hive admin theme, but it is not showing in the theme select list. Any idea why (and also where the list actually gets the theme’s name from)?

Offline

#2 2016-01-13 15:58:25

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,595
Website

Re: Admin theme selecting

If you name the folder hiveNeutral and the file hiveNeutral.php the same as your class, it works.

The other way around – changing the class to use a hyphen doesn’t work as php doesn’t like a hyphen in the class name.


TXP Builders – finely-crafted code, design and txp

Offline

#3 2016-01-15 12:57:40

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,270
Website GitHub

Re: Admin theme selecting

Yep, jakob is correct. Hyphens are out because PHP uses the theme name to make internal variables and classes. Underscores or camelCase are your only options.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#4 2016-01-15 13:33:01

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Admin theme selecting

OK, thanks. Regarding the theme name that appears in the select list – can we have a better way of doing that than relying on the directory name? Like a string or something?

Offline

#5 2016-01-15 13:39:04

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,270
Website GitHub

Re: Admin theme selecting

philwareham wrote #297412:

a string or something?

Hadn’t thought of that. Guess there’s no harm in wrapping the select list names in a call to gTxt(). Worst case scenario is that it’ll return the name of the folder itself. Give it a go if you like.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#6 2016-01-15 15:03:53

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Admin theme selecting

Bloke wrote #297413:

Give it a go if you like.

I don’t know how! :( Any help appreciated. :)

Offline

#7 2016-01-15 15:50:37

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,270
Website GitHub

Re: Admin theme selecting

philwareham wrote #297421:

I don’t know how! :( Any help appreciated. :)

Ahem, I lied. You don’t use gTxt() at all. Try adding a title entry to the array in your theme’s manifest() function. The prefs panel should then use that as the name.

If it doesn’t find one, you get the theme’s filename after it has been run through ucwords, which is what you’re seeing now.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#8 2016-01-15 16:39:39

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Admin theme selecting

Thanks Stef, I will try that.

Offline

#9 2016-01-30 12:31:37

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Admin theme selecting

There is now an alternative version of Hive in the 4.6dev core, with a flatter style and neutral colour scheme – this is in additional to the Classic Yellow Hive which will still be the default. Try it out and let me know if there are any display bugs.

Offline

Board footer

Powered by FluxBB