contextual names

Contextual (or "relative") names are cards names that can be interpreted differently based on context.

 

Contextual names are translated into "absolute" names in links, nesting, and Search.  These patterns are central to structure and Contextual Search.

 

 

A few examples of contextual names:

  • _
  • _self
  • _user
  • +address
  • _left+address
Note: to understand the following examples, you will need a basic understanding of Link Syntax and Nest Syntax.
 

Context: who is signed in

 

Let's consider the contextual name "_user".  The meaning of this name varies depending upon who is using the site.  For example, here is what we see if we link to _user with this link syntax "[[_user]]":

Ethan McCutchen

If you are not logged in, you will see this as a link to Anonymous.  If you're logged in as "Bob Dylan", you'll see a link to Bob Dylan

 

Context: card content

 

Here is the raw content of a card named Earth:

Our planet is named {{_self|link}}. {{_|name}} has seven continents.  See [[+continents]]

And here is what Earth looks like when it is rendered:

Our planet is named Earth. Earth has seven continents.  See Earth+continents

Note how in the context of the "Earth" card, both "_self" and its short form "_" refer to "Earth" and in the case of the

 

Context: plus card content

 

compound names support still more contextual names, including _left and _right.  Here is the raw content of a plus card named Earth+continents (the one we linked to in the previous example):

Australia, Asia, Africa, Europe, Antarctica, and North and South America are all [[_right]] on planet [[_left]].

And here is what that card looks like rendered:

Australia, Asia, Africa, Europe, Antarctica, and North and South America are all continents on planet Earth.

 

 

Use these terms in links, nesting, or Search:

 

_user

the card of the person currently signed in (see above)

 

_main

the main card of the page.  Required in Layout cards, but can be used anywhere.

E.g., the main card of this page:

 

_self, _, +

the card's name. You can also use _ for short.

E.g., in the context of the Earth card, these refer to Earth:

  • _self
  • _

...and these refer to Earth+continents

  • _self+continents
  • _+continents
  • +continents
Note that cards beginning or ending with "+" are contextual cards, and that "+address" refers to the same card as "_self+address".

 

_left, _right

the parts of a compound names's name.   _right is the rightmost part; _left is everything else.

E.g., in the context of Earth+continents

  • _self is "Earth+continents"
  • _left is "Earth"
  • _right is "continents"

...and in the context of Earth+continents+image

  • _self is "Earth+continents+image"
  • _left is "Earth+continents"
  • _right is "image"

 

_L, _R, _LL, _LR,  etc 

_L and _R are short-hand for _left and _right.  You can string L's and R's together to handle arbitrarily complex plus cards.

E.g., in the context of hay+bee+sea+dee

  • _L is "hay+bee+sea"
  • _R is "dee"
  • _LL (left's left) is "hay+bee"
  • _LR (left's right) is "sea"
  • _LLL (left's left's left) is "hay"
  • _LLR (left's left's right) is "bee"

 

_1, _2, _3, etc

Another way to refer to plus card parts.

E.g., in the context of hay+bee+sea
  • _1 is "hay"
  • _2 is "bee"
  • _3 is "sea"

 

  1. These terms can be used as variables in regular web addresses - see contextual web addresses.
  2. In the context of Search, _self refers to the left side of the card's name.
    E.g., if John+friends is a Search card, then _self  refers to John, not John+friends.  (This is considered a legacy issue and will be addressed in an upcoming release).

 

Discussion