00567: Add (:input select:) markup for select boxes

Summary: Add (:input select:) markup for select boxes
Created: 2005-10-21 11:14
Status: Closed - added in 2.2.0-beta17
Category: CoreCandidate
From: Pm
Assigned:
Priority: 55554 4444

RoadMap: 2.2.0

Version: 2.0.11
OS:

Description: Pm is planning to add an input form control to allow drop-down boxes or select boxes. The currently planned syntax is

    (:input select name=myopt
      "Option 1" 
      "*Option 2" 
      "value_3|Option 3" :)

where the "*" is used to denote any options to be selected by default, and the "|" is used to indicate an alternate value for the option (otherwise the option text is used).


would this be a way to select pagetemplates with it?

Yes. --Pm


IMHO, this markup should be able to act on regular page structures, aka item lists or even pagelist results, no? --Dfaure


This syntax looks fine. Is the newline necessary for the various options, or should it all be on one line? I would very much like to be able to dynamically create a pulldown menu in a pagelist template, with options something like "{=$name}|{=$pagetitle}" in a given group that could be selected for various purposes. Will it be able to do this? Caveman


Newline isn't necessary but is allowed. I'm not sure how to automatically generate one of these from a pagelist template without some really ugly markup, or some advanced lookahead. So far the best I can come up with is

(:if equal {<$Group}:)(:input select name=myopt (:if:)
  "{=$Name}|{=$Title}"
(:if equal {>$Group}:):)(:if:)

but I'm not entirely sure that will work. The mixture of (:if:) in the middle of the (:input ...:) markup is liable to confuse more than a few people. :-|

Pm


Perhaps what I need is

(:input select name=myopt "Option 1" :)
(:input select name=myopt "*Option 2" :)
(:input select name=myopt "value_3|Option 3":)

with a rule that there cannot be anything except spaces or newlines separating the (:input select ...:) items. Then the pagelist template would be

(:input select name=myopt "{=$Name}|{=$Title}":)

I'll have to think about this one. :-|

Pm


Thanks Pm. Actually, I was surprized your second markup wasn't your first choice, as it seems more intuitive (closer to real html). The first, FWIW, though requiring less typing seemed a bit quirky to me.

I'm really looking forward to this feature, as I have several uses for it, and I'm currently having to manually change each pulldown menus everytime I add a new page to my teams group. Being able to create this dynamically in a pagelist would be awesome. Automation makes things so sweet... Caveman

Agreed, the second markup is nicer. Kathryn Andersen August 04, 2006, at 06:25 PM