Hi Raffi,

you can generate a dropdown box as form field, by using the parameter "values" in the field definition [1].
E.g. set "values=in, ft, cm, m". You can also set a default value by adding e.g. "default=in".

Within the template you simply concatenate then the two values (i.e. the number field value and the unit field value) for the semantic annotation.

BTW: If people enter property values which do not comply with the defined type of the property, you can track the input errors via a special property (introduced in SMW 1.4.3). See [2]


[1] http://www.mediawiki.org/wiki/Extension:Semantic_Forms#Form_markup_language
[2] http://semantic-mediawiki.org/wiki/Semantic_MediaWiki_1.4.3#Tracking_input_errors
[3] http://en.wikipedia.org/wiki/Wikipedia:Conditional_tables

Raffi <raffi@gardenology.org> hat am 11. Oktober 2009 um 04:57 geschrieben:

> Thanks for the great tips so far, folks.  I'm going to test out the
> latest advice on turning the free text section on my site into a more
> structured section and see how I like it.
> Meanwhile, as I said, 99% of the pages on my site are going to be for
> all the garden plants of the world, and will use the same form.  I
> don't think I'll be needing much in the way of any other form for the
> foreseeable future.  The form is done, and I'm very happy with it
> overall, but still would like to make it a bit more streamlined if
> possible.
> Here is an actual plant I've added using the form, which I'll use as
> an example to explain the type of things that would be nice, but which
> I don't know how to do:
> http://www.gardenology.org/w/index.php?title=Dietes_bicolor&action=formedit
> For size, people have to type "24 in" or something in ft, m, cm, etc.
> This leaves a lot or room for error.  They could type in the word
> inches, or, not knowing SMW will automatically convert the output, put
> it in "24 in (30cm)".  In other words, there is a lot of room for
> mistakes.  Not a big deal.  I can easily put a note on the side, and
> if people make mistakes I can send them a quick explanation, or point
> them to a FAQ, but still, if there is a better way, where they can
> perhaps use a drop-down box for "in, ft, cm, m", it would be nice.
> Same with minimum temperature, if they could choose between C and F in
> a drop-down box.  Someone tried to explain how to me, but I think I
> followed the directions exactly and didn't have any luck.
> With image width, it's even easier, there is always a "px" necessary,
> and I don't want them to have to type it in, or see it.  It should
> preferably be behind the scenes.  Alternatively, I suppose I could
> just change it to 2 or 3 choices in a drop-down box, with the number
> followed by the px.  I know how to do that one, if that's the best
> solution.
> And finally, for flowering season, is there a more compact way I can
> express that in the the actual page that is generated by the template?
>  It currently shows up as a list on the final page, and takes up
> precious space there.  Can I convert what is being selected (early
> spring, mid spring, etc) into 12 consecutive boxes of a table whose
> colors are filled in or a text, based on which ones are checked off?
> Also, more importantly, is there a better way to gather this data so
> that people can search it better?  Maybe again as a max and min flower
> season?  Though the problem is that some plants don't fall neatly into
> that.  I dunno.
> So there it is, I'm actually okay with the way things are set up if
> need be, but since this is the only form I'm creating, and I'm so new
> to SMW/F I thought I would run it by some much more experienced people
> to make sure I get off on the right foot...  therefore, any and all
> thoughts and advice you see from looking at the form are appreciated.
> Thanks!
> Raffi
> http://www.gardenology.org
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Semediawiki-user mailing list
> Semediawiki-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user