Wagn makes it simple to link to create new cards, and to set default content values for that new card through the link syntax. (Note: default content that is not dependent upon links can be set using right forms)
Suppose you're building a contact database for Organizations, and you know that most (but not all) of the organizations will be in Oregon. You could use a link to enter "OR" in any new Organization card's "state" field. Something like:
In such cases, when you always want the same default value (Oregon), you could just as easily use structure to set the default. But links are especially valuable when the default value depends on context. You can create these kind of contextual defaults using nesting and contextual names. For example, suppose you want anyone to be able to create a Meeting card and have it automatically make that person the convener. Here's how that link might look:
Suppose you then want a link on your Meeting cards that lets you create an Action Item card that automatically fills out what meeting it was created from. Something like this:
To specify default content, you add one or more key/value pairs at the end of a link to create a new card. Each key specifies a compound names you want to put default content into, and each value is the default content that goes into that plus card. So http://www.wagn.org/new/Recipe?_serves=1 offers to create a Recipe card, with it's "+serves" card filled out with 1. Note that the name of the plus card has an underscore before it (this is to distinguish these from other keys Wagn uses in URLs — see web address for everything).
The type of the card being created must have been formatted with that plus card on it. I.e., in this case, "Recipe+*type+*content" must contain {{+serves}}.
Additional plus cards can be given default values by simply adding parameters:
- Always URL-encode any spaces, with %20
- If the plus card having default content handed to it is a Pointer, you can add multiple items separated with URL-encoded newlines = %0A
- "Link" view won't work with inclusions
- To insert actual inclusion markup, URL-encode everything:
{ = %7B, } = %7D, | = %7C, + = %2B, spaces = %20 - If the default content has a link using double brackets, you have to URL-encode the brackets:
[ = %5B, ] = %5D
http://www.wagn.org/new/Recipe?_notes=see%20%5B%5BChilaqiles%5D%5D - Note that the form must use the implicit relative, i.e. {{+serves}}, not {{_self+serves}}.