Any junction formed by joining to a card that's been joined to *template inherits, from the <card>+*template card:
  • initial [permissions][permissions]
  • content - initially (soft template) or permanently (hard template)
  • [Cardtype][Cardtype] - initially (soft template) or permanently (hard template)
For example, if birthday+*template exists, then John Abbe+birthday will inherit permissions, content and type from birthday+*template.

Cards inherit similarly from their [Cardtype][Cardtype]'s Cardtype+*template. If there isn't one they will inherit instead from the cardtype's first ancestor up the chain which has been joined to *template if there is one. (One interesting consequence is this creates a way to set default permissions - permissions on Basic+*template are inherited by all Basic cards.)

To do:

In options, remove the plus data-type menu, and at the end add a button "Create a template". Immediately following the button is the text "to be applied to all cards of this type" if it is a Cardtype card, otherwise "to be applied to any card joined to this card". In either case, clicking on the card creates a new card <card>+*template, giving the user the chance to edit default content, type and permissions; and select whether it's a hard or soft template. [I've made a drawing of what this might look like. --John]

The Cardtype of any junction card <Cardtype X card>+*template is permanently set to <cardtype>. For example Date+*template is of type Date.


note: type can be changed on cards using a type template only, but not on cards using a hard tag template.

Relevant terminology (to be moved to then transcluded back from a [Glossary][Glossary] card/section):

Template card - any junction card formed by joining to *template


Some potential issues and how they resolve:


Making a card's joinee a hard template card changes the card's type


For example, if form is type Cardtype and you:

1) create form+*template as a hard template, content=foo (type automatically sets to form)

2) create Joe+application and set it's type to form, then Joe+form's content automatically becomes foo

3) create application+*template as a hard template with type=RichText and content=bar, then Joe+application automatically changes type from form to RichText and it's content renders as bar (though foo may remain in the database)

Hard type templates override tag templates


For example, if you:

1) create bday+*template as a hard template, type=Date, content=eggs

2) create Date+*template as a hard template, content=spam, then type automatically sets as Date, and bday+*template's content now renders as spam (though eggs may remain in the database)

3) create Lew+bday, then it's type will automatically set to Date, and content to spam

(but if Date+*template is created as a soft template, then Lew+bday will use bday+*template)

I think that's what Ethan and i went through Monday, and now i'm wondering if they conflict, but i'm going to bed now. --John


------------
let's say that bday+*template exists and that it specifies cardtype=Date, AND Date+*template exists and specifies stuff.
now I create Lew+bday.  it will use bday+*template to specify that Lew+bday is of cardtype Date.  now does it ALSO then
use the Date+*template card?   My first though is: no if Date+*template is a soft template, yes if it's hard.    thoughts?

~~~~~

E&L say:

If a card's tag has a template and its type has a template, here's what you do:
  1. permissions: tag template permissions always override
  2. content: 
    1. if type is hard template, tags much use type template by definition.
    2. if type is soft template, then tag template is free and can be hard or soft
----

Hmm... John say: If the tag template has content (hard or soft), use it. Otherwise, use the type template content. This is on the thinking that if someone put content in the tag template, they wanted it to override the type template content.

E: our figuring was that you actually *can't* put custom content in the tag template if they type template is hard.  For example, if I make a card "biz address+*template" of type "address", and address already has a hard template at "address+*template", then the biz add card is already templated.  So in that case, it isn't a matter of resolving a conflict, in the sense that conflict is not supported ;)  To me this feels consistent with the idea of hard templating -- that every card of this type will always have this template.  A tag with that cardtype is just one subset of the type.

On the other hand, soft templating is all about overriding anyway.  start with this, and take it where you will.  I think this part is consistent with how you want it:  start with the type template, feed that to the tag template when you create it, and then feed that to any other tags when you create them.

-----------------------------

Question: Do we want to be able to hard set type and content separately?