• View
  • Changes
  • Options
  • Related
  • Edit
  • Table of Contents
    1. Examples
    2. How To
    3. Tips

    Forms are content patterns. Every day we encounter lots of formatted information: weather forecasts, sports cards, 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. These patterns help you compare and contrast information visually, and to notice missing information.

     

    Wagn lets you create forms and apply them to sets of cards, so they contain the same kinds of information, in the same layout.  It does so using two settings: *content and *default

     

     

    Examples

    Here's a form that is used to template Recipes:

    Preparation time: {{+preparation time|display:inline}}
    Serves: {{+serves|display:inline}}
     
    {{+ingredients|closed}}
     

    Preparation

     
    {{+preparation|closed}}
     

    Tags: {{+tags}}
     

    Comments

     
    {{+discussion|open}}

    You'll notice the form includes cards for recipe information like preparation and cook time, number served, ingredients, etc.  When a user edits a recipe, Wagn offers to add or edit those cards.

     

    Here are all of the Recipe cards — open some up and edit them to see how the form works in action:

    You'll also see the same pattern when you create a new Recipe card.

     

    How To

    Forms are settings, meaning configurations that can apply to any set of cards.

     

    *content and *default

     

    There are two setting cards that are used to format cards:

    • The *default setting controls the initial content for cards in a set.  If you change a *default setting, it won't impact existing cards in the set.
    • The *content setting controls the content of cards in a set on an ongoing basis.  If you change a *content setting, it will impact every card in the set.

     

    Navigating to Form Cards

     

    The first part of adding/editing a form is creating/finding the form card.  There are several ways to do this.

    1. If you already know the name of the form card, you can navigate straight to it by typing in the url or using the navbar.  Form cards are always named with this pattern: set+form_setting.  For example, User+*type+*content is a form card that combines the User+*type set with the *content form setting.  This card controls content for all the User cards (cards whose type is "User").
    2. If you go straight to the set card, from there you can click to add or edit the form setting. Notice how the User+*type card includes the *content setting card on it.
    3. To edit existing form cards, you can navigate to the setting card, where you will see the sets for that card.  For example, on *content, one of the cards you see under the +*type heading is User+*type+*content
    4. For sets related to a specific type, you can also start from type card.  For example, if you go to User and then click Options -> Settings, then you will see this same *content setting value beneath "Settings for All User cards".  
    5. You can also start from any card that is a member of the set of cards that your form will affect.  Try going to your personal card (or any User card), and clicking on Options->Settings.  Then click on *content to open the setting.
    6. Similarly, whenever you edit a card that is controlled by a *content setting, you will see a link at the top of the card that reads "Formatted by a form card".  Clicking on "form card" will take you to the *content setting card.

     

    Setting Defaults

     

    The simplest form setting is *default.  When you create a new card that has a *default setting, the new card will start with the same content, type, and permissions as the *default card.   After the card is created, it is no longer influenced by the *default setting in any way.

     

    For example, look at logo+*right+*default.  Notice that it is a blank Image card.  The set logo+*right refers to all the cards that end in "+logo".  Therefore, any time you create a card that ends in "+logo", you will start with a blank Image card.

     

    Similarly, country+*right+*default is a Phrase card that has the content "USA".  So any time you create a card ending in +country, your default content will be "USA".

     

     

    Setting Content

     

    Unlike *default, the *content setting continues to control a card's content even after it is created.  As a silly example, if I create a card called Recipe+*type+*content and I enter the content "Just cook it", then every recipe will have the content "just cook it".

     

    Obviously, that's not particularly useful, because you don't want the exact same information on each recipe, you want templates of information that allow for lots of relative info about each recipe.

     

    Consider again our example of the recipe form card:

    Preparation time: {{+preparation time|display:inline}}
    Serves: {{+serves|display:inline}}
     
    {{+ingredients|closed}}
     

    Preparation

     
    {{+preparation|closed}}
     

    Tags: {{+tags}}
     

    Comments

     
    {{+discussion|open}}

    Looking at that card, you'll notice lots of inclusions, like {{+ingredients|open}}.  We won't go into great detail about inclusions here, but here's a brief overview of how this works:

    • The double curly brackets represent an inclusion, meaning that one card is inside another.  In this case, the ingredients card is inside the recipe card.
    • Because of this inclusion, every recipe will include an ingredients list.
    • The "+" before ingredients indicates that this is a contextual name, meaning that the included card receives a name relative to the including card.  For example, if I make a recipe called "Lobster Bisque", then its ingredient list will be named "Lobster Bisque+ingredients".
    • The "open" refers to the view of the included card.  When you see the ingredients card inside the recipe, it will be open.

     

    Combining Content and Default

     

    To continue with our Recipe example, you may have noticed that the "+serves" cards on the Recipe are Number cards.  This is because serves+*right+*default is a Number card.  So, you see, by combining default and content settings, you can start to build sophisticated templates.

     

    See also

     

     

    Tips

    • Checkboxes, radio buttons, and other form elements can be added using Pointers.
    • You can add help text that shows up when inclusions are being created or edited.
    • Permissions on a card will be set by a form that applies to the card. However, while a *content permanently determines a card's content, the card's permissions are always editable later.
     
  • View
  • Changes
  • Options
  • Related
  • Edit

  • here we are

      --Anonymous (Not signed in).....Wed Jul 14 20:20:11 -0700 2010


    Tickets relevant to formatting

    Wheeled by Wagn v.