Adding "empty_label" parameter to PredefinedOptions tag

4 views
Skip to first unread message

Alexander Obuhovich

unread,
Nov 11, 2011, 4:55:24 AM11/11/11
to In-Portal Development
Tag PredefinedOptions is used to output all options, associated with a given field, e.g.
  • country list
  • state list
  • possible link statuses (Active, Pending, Disabled)

It has several special parameters:
  • "has_empty" - adds first empty option before other options
  • "empty_value" - value of first empty option
Problem is that there is no way to specify that empty options's text. Now there is with this patch and new "empty_label" parameter.



Ready for testing.

--
Best Regards,

http://www.in-portal.com
http://www.alex-time.com
predefinedoptions_tag_improvement.patch

Dmitry A.

unread,
Nov 13, 2011, 1:15:17 PM11/13/11
to in-por...@googlegroups.com
This is really cool and useful!

Can I specify a plain text and not the label in empty_label? Example, using +just test? That would be really cool too!

DA

Alexander Obuhovich

unread,
Nov 14, 2011, 6:13:27 AM11/14/11
to in-por...@googlegroups.com
Nope, label only for now. In all projects, that I was involved in I needed a label to be displayed instead 1st option, especially, when list of dropdown values are not labels at all (e.g. "None" (lu_None), "Please Select").

Phil -- wbtc.fr --

unread,
Nov 14, 2011, 8:22:41 AM11/14/11
to in-por...@googlegroups.com
Yes, this would be helpful in some case, as optgroup label is not displayed as empty value, but only when clicking to see all choices.


2011/11/14 Alexander Obuhovich <aik....@gmail.com>

Dmitry A.

unread,
Nov 19, 2011, 2:53:45 PM11/19/11
to in-por...@googlegroups.com
Hi guys,


Here is a little improvement to Alex's patch so it supports Plain Text Empty Option (ie. +please select, where + indicated that it's a non-label phrase)

Alex, please review if this can be included / committed to 5.2.0 branch


DA


predefinedoptions_tag_improvement_with_plaintext-Dmitry.patch

Alexander Obuhovich

unread,
Nov 19, 2011, 5:06:06 PM11/19/11
to in-por...@googlegroups.com
Seems ok, but use same function for string cutting in all patch, e.g. use "substr" or "mb_substr" in all 2 places.

Also you haven't attached this patch to the task.

Dmitry A.

unread,
Nov 19, 2011, 6:57:17 PM11/19/11
to in-por...@googlegroups.com
Thanks for review.

Update patch attached here and the task.


DA
predefinedoptions_tag_improvement_with_plaintext-Dmitry.patch
Reply all
Reply to author
Forward
0 new messages