Child pages
  • Adding "empty_label" parameter to PredefinedOptions tag
Skip to end of metadata
Go to start of metadata

Imported from: http://groups.google.com/group/in-portal-dev/browse_thread/thread/41c321a3714ed112#

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.

predefinedoptions_tag_improvement.patch

Related Tasks

INP-946 - Getting issue details... STATUS

6 Comments

  1. 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

  2. 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").

    On Sun, Nov 13, 2011 at 8:15 PM, Dmitry A. <dandre...@gmail.com> wrote:
    > 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

  3. 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.b...@gmail.com>

  4. 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

  5. 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.

    On Sat, Nov 19, 2011 at 9:53 PM, Dmitry A. <dandre...@gmail.com> wrote:
    > 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