[pmwiki-users] Wikiform - empty fields, numeric type, page names

John Rankin john.rankin at affinity.co.nz
Tue Dec 13 15:28:47 CST 2005


On Tuesday, 13 December 2005 11:27 PM, Andreas Mühlhausen <mail at andreas-muehlhausen.de> wrote:
>Hi John,
>
>>>2) Is it possible to define a numeric field type, because I want to use 
>>>a numeric ordering in the (:wikilist:)?
>>
>>This can be added. To make the sort work, the form administrator will need 
>>to specify a length and the data will be automatically zero filled.
>>  
>>
>I think a solution with zerofilled values is not so good, because I have 
>values like i.e. 300 kilometres and it doesn't look quiet good if the 
>list displays them as '0300 km'. This is why I asked for
>numeric values.

Well, it doesn't necessarily have to display as 0300. As long as we
know it's an integer field, and it's 4 digits long, we can zero pad
the value for sorting but store and display it without leading zeros.
>
>>Do you need negative values? These are a bit trickier.
>>
>
>No, I need only positive integer values, but an appended unit
>is preferred - like '300 km' or '2200 m' or '20 $'. A better
>way to deal with the units would be, to append them as lables
>after the input field, but I haven't found a way to do that in
>the form template.

In the short term, while I think of a way to specify a suffix in 
the markup, you could add the units to the field prompt:

:Distance (km): 300

An advantage of just putting it in the field prompt is that
the units will then appear in a table column heading. And it
requires no new code or markup rule.

Presumably, we'd need to support a prefix as well as a suffix:

:Cost: $25

:Length: 100 m


>>>3) Is it possible to replace the numeric pagename with the contents of a 
>>>field?
>>
>>In one of the field values, you can include (:title Some text for title:).
>>It would also be possible to add a new field data type that automatically
>>turns the text into a title. However, I'll have to think about how to
>>display this.
>>
>The main reason why I'm asking is the kind of 'wiki trail' on
>the single pages. I would prefer a meaningful pagename than a
>pagenumber ;-).

I use the forms recipe in conjunction with the markup extensions,
so the previous / next links gain a tool tip of the first field
on the form. We could make this use either the [[00123 |+]] markup
(new in pmwiki 2.1) to use a (:title:) or use the value of the
first field as the link text. To me, using the value of the
first field seems a sensible thing to do.


-- 
JR
--
John Rankin






More information about the pmwiki-users mailing list