Ed Johnson wrote on 22 Mar 2010 18:06
The specific properties you can use on a static field:
Testing this I learned a few things.
The label property works and appears to be valid. The documentation should be updated to describe this.
The before and after properties sort of work. Before is displayed above the static text and after is displayed below the static text. This might be useful, but simply using another static field probably makes more sense since static fields can be styled and before and after cannot.
Basic inline styling seems to work fine as the example shows (bold, italic, strikethrough, etc.). I found that I could do some "fancier" styling by using [[span class="... ]] like this:
fields:
introheader:
type: static
value: [[span class="myform-static-label"]]A Nicely Styled Header For My Form[[/span]]@< >@
The key to success was appending the @< >@ to the end of the line. Without that, the span method of formatting breaks.
-Ed
Interesting… thanks for this!
Edit: Doesn't seem to work. All I get is a blank white space, not even the text I entered shows up. Can you link to a page where you're using this?
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
Template Page: http://my-wd-local.wikidot.com/demoform:_template
Sample Form: http://my-wd-local.wikidot.com/demoform:1
CSS for the forms and my custom class:
The first field ("Site Setup Questionnaire") is static with the [[span class= ... ]] styling.
I spent a lot of time on the CSS to get what I think is a nicer layout. I used the "join" property on all fields to stack them and then out-dented the label and created more space around the elements to make it more readable.
The private site I invited you to join (and made you an admin of) also has this working.
Note: I see I made a typo in "The key to success" line above (@> instead of >@). The syntax in the code block is correct. Perhaps that's where I led you astray? [edit: it's fixed now]
-Ed
Community Admin
The properties like: label, join, before and after are for all field types.
its like that because static field is block type.
Bartłomiej Bąkowski @ Wikidot Inc.
';.;' TeRq (Write PM)
What threw me off is this in the documentation:
I read that as the only property you can use. After rereading the data form docs (again!), I see that label, join, before and after are not listed as "specific properties" for any other field types.
With all due respect, the docs could be clearer and less ambiguous if Field Properties and Field Types were clearly separated.
Field Properties
Properties that apply to all field types
The 'Label' property
If you specify a 'label' property then the field gets that text in the left column, or before the field for joined fields. If you do not specify a label then the field has an empty space in the left column, or is squashed up after the previous field, for joined fields. For example:
The 'Join' property
The 'Before' property
The 'After' property
Properties that apply to specific field types
There are additional properties that only apply to specific field types. These are documented below with the field type(s) they apply to.
Field Types
… and so on …
Community Admin
Thx for this idea, documentation is changed, we need also to change h2, h3, h4 for better presentation — I will talk with squark about it.
Bartłomiej Bąkowski @ Wikidot Inc.
';.;' TeRq (Write PM)
Ed, good work on the static fields, I've already started to use it.
I still don't quite understand what the Join property is supposed to do.
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
Thanks, Rob. What join essentially does is combine fields into a single table cell as opposed to creating separate table rows for each field. If you create a couple of short forms and view the page source, you'll see the difference pretty clearly. I futzed with the CSS quite a bit to get it looking the way I wanted. From my futzing around, I think using join provides more control over the layout (at least the way my brain works!).
Without Joinfield type
field label
field type
field label
field type
-Ed
Community Admin
TeRq,
The docs are much more clear now. Thanks for updating them. Now go kick Squark and have him fix up the header CSS! ;)
-Ed
Community Admin
Thanks! This has helped me tremendously. I need this for the static fields and I added collapsible blocks as per your other example. Just what I needed.
Thanks Ed and everybody else.