Page 1 of 1

array "title" vs. "name"

Posted: Wed Mar 11, 2015 12:03 am
by Don Chambers
After going through a bunch of themes, I find a number of theme configs define their options much like this:

Code: Select all

    array(
        'var'           => 'navlink1text',
        'title'         => 'Navlink #1 Text',
        'description'   => 'Enter the first navigation text',
        'type'          => 'string',
        'default'       => 'About',
    ),
Note 'title'. This does not display on the backend. 'description' does display, but it is only revealed by clicking on the little info button. 'name' (not shown above) is what I have always used in my themes, and it works where 'title' does not.

So, either 'title' has to be restored, or a lot of themes need to be modified. I believe restoring 'title' is the way to go because there could be a lot of custom themes that are not in github.

Re: array "title" vs. "name"

Posted: Wed Mar 11, 2015 2:22 pm
by onli
When did that work last? If that broke in 1.2 for example, it does not seem to be necessary to restore it.

Re: array "title" vs. "name"

Posted: Wed Mar 11, 2015 2:25 pm
by Don Chambers
I couldn't tell you when it broke, I only know we have many themes in additional_themes that use it.

Re: array "title" vs. "name"

Posted: Wed Mar 11, 2015 2:58 pm
by onli
Maybe someone with an 1.7.8 test-installation could look into one of the old themes and test it? I'd immediately fix it if it worked in 1.7.8 and we broke it by accident in 2.0. But if it broke before, I would vote for keeping the hopefully smaller code - based on my expectation that those old themes are not used anymore anyway, and if they are and the title is not shown, that is not a really grave bug. We could then document how exactly the syntax has to look for 2.0

Re: array "title" vs. "name"

Posted: Wed Mar 11, 2015 3:25 pm
by garvinhicking
Hi!

I checked; with 1.7.8 it was "title".

Ideally for 2.0 I propse to accept both "title" and "name" (use "name" if existing, fallback to "title"). This way all (now patched) config.inc.phps should work...?

Re: array "title" vs. "name"

Posted: Wed Mar 11, 2015 4:28 pm
by onli

Re: array "title" vs. "name"

Posted: Wed Mar 11, 2015 4:33 pm
by Don Chambers
I have checked with 1.7.8, 1.7.2, 1.6.2, and 1.5.5 - "title" doesn't work in any of them.... Yes, I really have a blog running 1.5.5, which I didn't realize until just now! :lol:

Because we have so many themes that use "title", I think it should work.... either that, or we should modify all those themes to use "name" instead.

I suspect there are probably custom themes out there using "title", but the only way they would know it no longer works is to change theme options... and how often does anyone really change their theme options once configured?

Re: array "title" vs. "name"

Posted: Wed Mar 11, 2015 4:38 pm
by onli
Oi? One of you two has to be wrong!

Re: array "title" vs. "name"

Posted: Wed Mar 11, 2015 4:45 pm
by Don Chambers
onli wrote:Oi? One of you two has to be wrong!
I tested using the 1024px theme. The first two configuration items are as follows:

Code: Select all

    array(
        'var'           => 'colorset',
        'description'   => 'Select colorset option',
        'type'          => 'select',
        'default'       => 'blue',
        'select_values' => array('default' => 'Blue', 'red' => 'Red')
    ),
    array(
        'var'           => 'contentposition',
        'title'         => 'Sidebar Position',
        'description'   => 'Sidebar left or right',
        'type'          => 'radio',
	  'radio'         => array('value' => array('true', 'false'),
					'desc' => array('Left', 'Right')),
        'default'       => 'true',
    ),
The first one 'colorset' doesn't have name or title, but the description is displayed. The second one uses title, which doesn't display, but again the description does.

Re: array "title" vs. "name"

Posted: Thu Mar 12, 2015 10:02 am
by garvinhicking
Hi!

That is strange. I must admit I read the code, and not test it with an actual installation.

The code uses 'title' of the property bag... But if Don really tested it with an actual installation, I think we should believe him, and not my reading of the code ;-) Sorry for the noise.

Re: array "title" vs. "name"

Posted: Sat Mar 14, 2015 11:28 pm
by onli
Ok, then if that broken for such a long time, I would prefer not to re-introduce it. I will close the issue, let us just try to think about this when rewriting the documentation.

If any of the important themes (all new ones, bulletproof, maybe idea) are hit by that change, we should fix those. I'll take some minutes to see why this is broken though, maybe there is a bigger bug behind this.

Maybe my reaction here is wrong, then just someone else do this please. I just do not want to have two ways to do the same thing, that would confuse me.

Re: array "title" vs. "name"

Posted: Sat Mar 14, 2015 11:43 pm
by onli
It is name, because templates are using serendipity_plugin_config, where that has always been "name" I think.
Which really is confusing, because the syntax in the templates - how the configuration is defined - looks much more like an internal config template. That probably fooled you, garvin?

Maybe that would be something for the roadmap, to use only one way to print configs everywhere?