[pmwiki-users] pmwiki-users Digest, Vol 14, Issue 110

Ben Stallings Ben at InterdependentWeb.com
Thu Aug 24 18:23:08 CDT 2006


PM wrote,

>>(:radio State default="OK" TN|Tennessee NY|New York OK|Oklahoma:)
>> 
>> would produce
>> 
>> <br><input type="radio" name="State" value="TN"> Tennessee
>> <br><input type="radio" name="State" value="NY"> New York
>> <br><input type="radio" name="State" value="OK" checked> Oklahoma

>
> The first thing I'll hear from site administrators will be
> "How can I change the <br> to be something else?  What if I want
> the radio buttons to appear in a line, or in a table?"

I'm running into this with my SelectQuery recipe as well; people want more control over the display.  Come to think of it, so do I.  ;-)

I'm toying with the idea of writing a (:repeat:) markup so that you could write,

(:repeat X=TN,NY,OK Y="Tennessee,New York,Oklahoma":)
(:input radio State X:)Y \\
(:endrepeat:)

and X (or whatever string you typed before the =) would be replaced with each of the values in turn.  If you didn't want the linebreak, you could just leave it out of your markup.  To check the right one, you'd either need some sort of conditional markup or the soon-to-be-realized $InputValues variable.

If I wrote this as part of SelectQuery, it would tie in like so:

(:selectquery tables=cats columns=name,birthdate,color,breed display=repeat:)
:'''{`name`}''' : A {`color`} {`breed`}{(`birthdate` ? born on {`birthdate`} : )}.
(:endrepeat:)

Unfortunately I'm not available to write it just now, so I've started a PITS item with the (first) suggestion at http://www.pmwiki.org/wiki/PITS/00793 .  --Ben





More information about the pmwiki-users mailing list