Typing custom properties?

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Mekk
Regular
Posts: 54
Joined: Tue Jul 22, 2008 7:53 pm
Contact:

Typing custom properties?

Post by Mekk »

It would be nice if I could make some custom property to be shown as a drop-down setting instead of textfield. Any suggestions what could be the easiest way to implement this?

(my use case: I want to introduce some article classifier - "normal", "short", "wide" - to be used in .tpl and .css to pick different layouts)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Typing custom properties?

Post by garvinhicking »

Hi!

That's hard because it would lead to endlessly long configuration fields in the custom entryproperties plugin. The contactform plugin is a good example for such bad configuration syntax.

The best way is to create your own event plugin listening in backend_entry hook and emitting your dropdowns and store them in th e entryproperties DB table.

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