Feature request: presets for custom fields

Creating and modifying plugins.
Post Reply
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Feature request: presets for custom fields

Post by yellowled »

The entryproperties plugin offers the option to add custom fields for entries. Sometimes, it would be useful to be able to add “presets” to those fields.

For example, I use custom fields in the S9y InfoCamp blog to add urls to and sizes of the mp3 and ogg files to entries. The actual values for the url fields are very much alike, only the number of the episode changes.

Suggested syntax: key:value, i.e. “Customfield1:Presetvalue1,Customfield2:Presetvalue2” etc. Or just use “Customfield1,Customfield2” to not use presets.

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

Re: Feature request: presets for custom fields

Post by Don Chambers »

Excellent suggestion.
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Feature request: presets for custom fields

Post by garvinhicking »

Hi!

Good idea. Shouldn't be too hard to implement.

Regards,
Garvin
# 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/
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Feature request: presets for custom fields

Post by yellowled »

Should be possible to “mix” key:value pairs as well, i.e. “Customfield1,Customfield2:Presetvalue2”.

YL
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Feature request: presets for custom fields

Post by garvinhicking »

Hi!

Just committed to the 1.7 branch. Please test if this works for you, then I'll commit to 2.0 tree as well.

New variable also allows to escape ":" and "," if you need to use it for the default value; thought that might be important.

Regards,
Garvin
# 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/
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Feature request: presets for custom fields

Post by yellowled »

Works just fine for me, including the escape mechanism.

YL
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Feature request: presets for custom fields

Post by yellowled »

Hmmmm. In 1.7-alpha1, I get this when publishing an entry:

Code: Select all

== TESTING ERROR MODE ==

Array
(
    [0] => 2
    [1] => explode() expects parameter 2 to be string, array given
    [2] => /var/www/virtual/xxx/sub.domain.tld/plugins/serendipity_event_entryproperties/serendipity_event_entryproperties.php
    [3] => 179
    [4] => Array
Full error log: https://dl.dropbox.com/u/691134/entryprop-error.txt

Might be due a strange setup in my dev blog, though.

YL
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Feature request: presets for custom fields

Post by Timbalu »

Could you please check if you have this last commit change in it?
https://github.com/s9y/Serendipity/comm ... erties.php
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Feature request: presets for custom fields

Post by yellowled »

Probably not, I haven't updated this dev blog in a while since I've been working on 2.0. My bad. I will report back if updating does not fix it.

YL
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Feature request: presets for custom fields

Post by yellowled »

yellowled wrote:Probably not, I haven't updated this dev blog in a while since I've been working on 2.0. My bad. I will report back if updating does not fix it.

EDIT: JFTR, it works fine in latest 1.7.

YL
Post Reply