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.
Decko lets you create forms and apply them to sets of cards, so they contain the same kinds of information with the same structure. It does so using two settings: *structure and *default
Open these two Recipe cards, and you'll see they have the same structure:
Chilaquiles+ingredients
Tortilla
Tomatos
Chile
Chicken (optional)
Cheese
CreamChilaquiles+preparation
- 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)
Chilaquiles+discussion
Testing out discussion
+ingredients
Pork
Water
Salt
Lime
+preparation
Put the pork in a pan and cover (barely) with water. Sprinkle liberally with salt. Cook on medium flame until the liquid is reduced to a small amount that barely covers the bottom of the pan. Be sure to turn the pieces of pork halfway through.
Pull the pork out and shred/pull. Return to the pan and squeeze in the juice of two limes.
Cook until the pork starts to crisp.+discussion
You'll also see the same pattern when you create a new Recipe card.
Here's the structure rule that is used to template Recipes:
You'll notice the structure nests cards with recipe information like preparation and cook time, number served, ingredients, etc. When someone edits a recipe, they can edit those nested cards. (See sample recipe edit form.)
*structure rules control cards' type and content. Like all rules, structure rules apply to a specific set of cards. Changing a *structure rule will impact every card in the set. Structure rules can be seen and edited in a card's dashboard (or "cardboard"), which is accessed via the ellipses icon (space_dashboard ) in a card's menu.
Consider again our example of the recipe form card:
Looking at that card, you'll notice lots of nesting, like {{+ingredients|titled}}. Here's how this works:
The important pattern to understand is that these structured nests establish naming patterns. All the cards that contain information about ingredients will have names that begin with the recipe name and end with "+ingredients".