Page 1 of 1

Feature request: presets for custom fields

Posted: Sat Oct 27, 2012 3:52 pm
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

Re: Feature request: presets for custom fields

Posted: Sat Oct 27, 2012 4:25 pm
by Don Chambers
Excellent suggestion.

Re: Feature request: presets for custom fields

Posted: Mon Oct 29, 2012 12:25 pm
by garvinhicking
Hi!

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

Regards,
Garvin

Re: Feature request: presets for custom fields

Posted: Mon Oct 29, 2012 3:32 pm
by yellowled
Should be possible to “mix” key:value pairs as well, i.e. “Customfield1,Customfield2:Presetvalue2”.

YL

Re: Feature request: presets for custom fields

Posted: Tue Oct 30, 2012 10:48 am
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

Re: Feature request: presets for custom fields

Posted: Wed Oct 31, 2012 9:33 pm
by yellowled
Works just fine for me, including the escape mechanism.

YL

Re: Feature request: presets for custom fields

Posted: Thu Nov 29, 2012 11:37 am
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

Re: Feature request: presets for custom fields

Posted: Thu Nov 29, 2012 12:16 pm
by Timbalu
Could you please check if you have this last commit change in it?
https://github.com/s9y/Serendipity/comm ... erties.php

Re: Feature request: presets for custom fields

Posted: Thu Nov 29, 2012 1:53 pm
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

Re: Feature request: presets for custom fields

Posted: Thu Nov 29, 2012 2:04 pm
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