array "title" vs. "name"

Discussion corner for Developers of Serendipity.
Post Reply
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

array "title" vs. "name"

Post 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.
=Don=
onli
Regular
Posts: 2822
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: array "title" vs. "name"

Post 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.
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: array "title" vs. "name"

Post by Don Chambers »

I couldn't tell you when it broke, I only know we have many themes in additional_themes that use it.
=Don=
onli
Regular
Posts: 2822
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: array "title" vs. "name"

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: array "title" vs. "name"

Post 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...?
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
onli
Regular
Posts: 2822
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: array "title" vs. "name"

Post by onli »

Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: array "title" vs. "name"

Post 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?
=Don=
onli
Regular
Posts: 2822
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: array "title" vs. "name"

Post by onli »

Oi? One of you two has to be wrong!
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: array "title" vs. "name"

Post 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.
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: array "title" vs. "name"

Post 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.
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
onli
Regular
Posts: 2822
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: array "title" vs. "name"

Post 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.
onli
Regular
Posts: 2822
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: array "title" vs. "name"

Post 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?
Post Reply