Edit…
Mark…your extension seems to be doing exactly what I was looking for though I believe
these results are probably unintended and due to my improper usage.
I came across your extension while looking for a solution to provide Custom Dropdown Fields the ability to group selection items; thus providing a label for each group of selections to provide a more intuitive experience for the user entering data via the Weblog Publish Panel.
Maybe I’m wrong about my application but, it seems your intent with this extension was not aimed at the back end experience? Could you clarify?
What I was doing was ignoring ignoring the use of “—” to achieve an empty option which, if I’m correct, the extension is supposed to replace with the “keyword” entered in the extension settings (is this correct?).
In my Custom Dropdown when setting the selections I added a label
// with some testing it turns out that quotes rendered to the Dropdown in the
// Publish page so I eliminated.
<optgroup label=Identities>
So what was entered in for the dropdown selections was
<optgroup label=Identities>
Logo
System
</optgroup>
<optgroup label=Print>
Ad
Book cover
Brochure
Music CD
</optgroup>
And the result is that I get the desired label in the dropdown applied to the publish page: Identities.
Now, the thing is it’s not applied correctly - though the page validates. What occurs is
the
<optgroup label=Identities>
entered as a selection for the Custom Dropdown is rendered to the Publish Page mark-up as just that, an option
//rendered Weblog Publish Page
<select name='field_id_3' class='select' >
<option value='<optgroup label=Identities>'><optgroup label=Identities></option>
<option value='Logo'>Logo</option>
<option value='System'>System</option>
<option value='' selected='selected'></option>
<option value='<optgroup label=Print>'><optgroup label=Print></option>
<option value='Ad'>Ad</option>
<option value='Book cover'>Book cover</option>
<option value='Brochure'>Brochure</option>
<option value='Music CD'>Music CD</option>
</select>
Wondering what you think about this, since it’s actually not being applied correctly with this (probably unintended) usage?