What are Forms?
Forms are patterns of content. Every day we encounter lots of formatted information: weather forecasts include temperature, cloudiness, humidity and so on; sports cards include a player's various statistics. Restaurant menus, user profile pages, tax documents and nutrition labels each have their own pattern of what information is included, and how it is laid out. Whenever you want to organize sets of information, these patterns help you compare and contrast information visually, and to notice missing information.
Wagn lets you create forms (called "cards"), and to apply a form to many cards, so that when you have a set of cards that are about the same kind of thing, you can be sure they will all contain the same information, in the same layout.
Type forms apply to cards of a particular cardtype. For example, the type form associated with the Recipe cardtype is applied to every Recipe card, so that each Recipe shows how many people it serves, a list of ingredients, how to prepare the dish, etc.
The other kind of form is a right form, so-called because it applies to all cards that have a given card name as the right-most part of their name. For example, the right form connected to serves is applied to every card that ends with +serves — Carnitas+serves, Dahl+serves, etc., in this case simply ensuring that each of those cards contains a number.
Examples
Here's the whole Recipe type form:
It includes plus cards for information relevant to any recipe: preparation and cook time, number served, ingredients, etc. When a user edits a recipe, Wagn offers to edit those plus cards (or create them if they don't exist yet). Here are all of the Recipe cards — open some up and edit them to see how the form works in action:
Preparation time: 10 minutesPreparation time: 5 minutesPreparation time: 5 minutesPreparation time: 5 minutesPreparation time: 5 minutesPreparation time: 5 minutesPreparation time: 5 minutesPreparation time: 5 minutes Oops! I tried more than the maximum number of times to render Dahl, but then stopped, fearing infinity.Serves: 61 cup red lentils 2 cups water 1/4 cup coconut milk 1 tablespoon cumin powder 1 tablespoon coriander powder 1 ...Preparation
Tags:Comments
Serves:Preparation
Tags:Comments
Serves:Preparation
Tags:Comments
Serves:Preparation
Tags:Comments
Serves:Preparation
Tags:Comments
Serves:Preparation
Tags:Comments
Serves:Preparation
Tags:Comments
Serves:Preparation
Tags:Comments
Preparation time: 30 minutesServes: 4Tortilla Tomatos Chile Chicken (optional) Cheese CreamPreparation
...
- Place the tortillas in a pan with oil until they are really crunchy
- Prepare the salsa (placing tomato in a pan with oil, onion and chile)
Tags:Comments
Preparation time: +preparation timeServes: 43 cucumbers - 2 peeled, seeded and chopped; 1 coarsely chopped for garnish 1 1/3 cups lowfat yogurt 1 1/3 cups ...Preparation
Tags:Comments
Oops! I tried more than the maximum number of times to render Dahl, but then stopped, fearing infinity.Preparation time: +preparation timeServes: 6...
- 1 lb boiling potatoes
- 1 cup olive oil
- 1 large onion, chopped
- 1 1/2 teaspoons salt
- 1 lb kale, center ribs discarded
- 7 large
Preparation
Tags:Comments
Preparation time: 20 minutesServes: 13 eggs dash of milk 2 cloves garlic, chopped/mashed some onion, chopped half a faux sausage, chopped half a tomato, chopped grated cheddar cheese butter ...Preparation
Tags:Comments
Preparation time: 20 YearsServes: 6500000000Hubris.Preparation
Mix one part nanomachines, several thousand parts thermonuclear device, and a dash of zombies. Continue business as usual.
Tags: +tagsComments
+discussion
How To
Table of Contents
Forms are, like everything else in Wagn, cards. Specifically, they are plus cards whose right-most part is either *tform — for type forms, or *rform — for right forms.
To create a type form, join a cardtype card to *tform. For example, the form for all Recipe cards is Recipe+*tform.
To create a right form, join any simple card to *rform. For example, the right form for all cards ending in "+serves" is serves+*rform.
Building a Type Form
Building type forms typically relies heavily on plus cards, inclusions and views, so make sure you understand them first before giving this a try. When you're creating a form for creating common content and layout, for each piece of information you want on the form, you'll add a relative inclusion. Often you'll also have some text to label an inclusion (though you could also use the titled view).
Here's an example, showing part of Recipe+*tform:
Serves: {{+serves}}
{{+ingredients|open}}
Preparation
{{+preparation}}
Note that the layout and styling you apply to text and to inclusions will affect the cards the form applies to.
Right Forms
Right forms are often used simply to set the card type of a plus card in a type form. For example, to make it so that every recipe's "+serves" card will contain a number, you would create serves+*rform and set it's card type as Number (not entering any content in it, and leaving it as a soft form). Then when someone creates a recipe, they're offered the correct editor for the number of servings. One of the most powerful cardtypes to use in this way is Pointers:
Autofill and default cardtypes in Pointers
When you start typing an item in a Pointer, if you pause Wagn will do its best to fill in the rest by listing the names of existing cards that begin with whatever you typed in (much like it does in the Search bar).
If the Pointer is in a form, you can restrict Wagn to guessing from a subset of cards. For example, in a Session cardtype on a Wagn for a conference, you include {{+participants}} on Session+*tform so that each Session card will ask for a list of participants. If you create "participants+*options" as a search for User cards — {"type": "User"} — then items in "Making Wikis Welcome+participants" will autofill with Users' names.
Let's suppose you type in Frank Zappa, who doesn't have a User card yet on that Wagn. After you save, when you click on the gray "ADD FRANK ZAPPA", the card's type will automatically be set to User. Wagn knows to do this because the search specified the User type. You can alternately specify this when including the Pointer in the form, with: {{+performers|type:User}}. This will take precedence over participants+*options if both are present, and specify different types.
Forms Can be Soft or Hard
By default, new right forms are soft, which means that cards they apply to draw their initial content from the form, but can be edited later. New type forms default to being hard, meaning that the cards the form applies to are not editable — when you edit them you are actually editing just the inclusions in them. You can change a form's soft/hardness whenever you're editing a form, with these buttons just above the edit box:
Tips
- If you only want to edit one item on a card with a form, you can double click in that text and only that item will be opened for editing.
- You can add help text that shows up when relative inclusions are being created or edited.
- Whenever you edit a card controlled by a hard form, there's a link to the form itself at the top of the card — just click on the word "form" in "Formatted by a form card."
- Permissions on a card will be set by a form that applies to the card. However, while a hard form permanently determines a card's content and cardtype, the card's permissions are always editable later.
- In general, when a type form and a right form would apply to a given card, the right form takes precedence.
- Right forms have all of the same capabilities as type forms. You can put several relative inclusions in them, set them to be hard, etc. If you use a right form just to set a card's type and you want it to be a hard form, make sure to set the rform hard.
- Sometimes you have complex information to enter in relation to cards of a given type, and you want to use that information to generate a nice clean view (probably using virtual cards) on the cards themselves. For such cases, you can use the customizability of the Related tab to put data entry there, and create the nice view on the cardtype's form.
- Permission to edit a form card itself is determined by the permissions set on the left side of the card. E.g., whether you can edit "serves+*rform" is determined by whether you can edit "serves". This is to let you have a form allow editing of cards controlled by it, and still not allow editing of the form card itself.



