Pointer+input options

Pointer+view interface
Pointer cards can have one or more items in them, each item "pointing" to another card. In view mode, Pointers have an "add/edit" link which you can click on to go to edit mode. In edit mode, there are several different interfaces you may see which let you specify one or more items which go in the Pointer.

 

Pointers are most often used to create a kind of relationship among cards. The example shown here is in a Wagn for a conference. A Session cardtype was created, and formatted so that each session would have a Pointer card (+participants), where each item in the Pointer is a User card of someone who took part in that conference session. This has several advantages over typing people's names into a regular text card:

  • Wagn can provide a list of relevant cards for you to choose from when editing the Pointer, or guess what card you intend to point to when you start typing.
  • Each Pointer item becomes a link to a card, without any markup (and if the item points to a card that doesn't exist, Wagn invites you to create it, and can set it the correct type!
  • Automating the relationship in the other direction becomes possible. In the example described above, using a Pointer to list Session participants enables you to put a virtual card on each User card, automatically listing all of the sessions that person participated in.

To get most of these advantages, you have to tell Wagn what kind of cards go in the Pointer. In the example here we're talking about people, so we created "participants+*options" as a Search card, and put this CQL in it:

{"type": "User"}

We can then choose an input interface by creating "participants+*input". There are a couple of input interfaces which let you choose one item when editing:

  • select — a pop-up menu of card names
  • radio — a list of card names next to radio buttons

A conference session with only one participant would be pretty boring, so in this example we would use an interface that lets you choose as many items as you like (you can set a maximum number of items; in this case you would do so by creating "participants+*max"):

  • checkbox — a list of card names next to check boxes
  • multiselect — a scrollable box listing card names
  • list (default if you don't create +*input) — allows typing text into separate boxes

Pointer+edit interface
Most of these interfaces are fairly common and require little explanation. The last one (list) is unique to Wagn, and is the one we chose in this case because it is the only way that you can add items that aren't already in the system, and at this conference we knew there would be people who didn't have User cards. Wagn still does its best to help out, offering a menu of guesses (much like the navbox) when you start typing, based on the "participants+*options" card described above. You can add items by clicking on the "add another" link, and delete an item by clicking on the red X next to it.

 

Let's suppose you type in Frank Zappa, who doesn't have a User card yet on that Wagn. After you save, if you click on the gray "ADD FRANK ZAPPA", the card's type will automatically be set to User. Wagn knows to do this because "participants+*options" said the type is User. (You can alternately specify a type 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.)

 

The radio and checkbox input interfaces let you put an explanatory label (text and/or images) next to any option, e.g. to make a label appear next to "Grant Kruger" you would put it in "Grant Kruger+description". Note that +description is just the default; you can change the term used to make labels globally by putting a different card name (e.g., "summary") in "*option label". Then Grant's label shown would be whatever is in "Grant Kruger+summary". You can even get different labels on an item depending on what set of Pointers it's appearing in. For the example we've been using (Pointers ending with "+participants"), if you create "participants+*option label" and put "image" there, then Grant's label in Pointers that end with +participants would be whatever is in "Grant Kruger+image".