I see several problems
Character
- This appears to be a header (i.e. in edit mode it looks like
# Character
). If this is case, it must come after the YAML block.
No.:
- YAML keys containing a dot (period character) are allowed but can be problematic. I suggest renaming to
Number
instead of abbreviating.
Sex <% await tp.system.suggester(["Male","Female"], ["Female","Male"]) %>
- There needs to be a colon after the word ‘Sex’. Otherwise it won’t be a valid YAML item.
- The first array in the
suggester
function is the list of options displayed for selection. The second array is what value is actually returned. The way this is written, the user will select Male
but the displayed value will be Female
. Maybe you intended to gender flip things?
Kind <% await tp.system.suggester(["God", "Titan", "Giant", "Monster", "Mortal", "Nymph", "Primordial"], ["God", "Titan", "Giant", "Monster", "Mortal", "Nymph", "Primordial"]) %>
- There needs to be a colon after the word ‘Kind’. Otherwise it won’t be a valid YAML item.
Mortal: <% tp.frontmatter.["Mortal" await tp.system.suggester(["Mereo", "King", "Villain"], ["Mereo", "King", "Villain"]) %>]
- The closing
]
that matches the first [
is outside the Templater closing%>
. It needs to be inside. Definite parser error.
- Even if the bracket was in the correct place, the
"Mortal"
text followed by tp.system.suggester
is another parser error.
- At this point, the frontmatter for
Mortal
has not been defined. In fact, I doubt any of the keys have been defined in the tp.frontmatter
construct. Templater is still in the process of creating the note.
To fix, I suggest this Templater template:
<%*
const name = await tp.system.prompt('Character Name');
if (tp.file.title.startsWith('Untitled')
{
await tp.file.rename(name);
}
const sex = await tp.system.suggester(["Male","Female"],["Male","Female"]);
const kind = await tp.system.suggester(["God", "Titan", "Giant", "Monster", "Mortal", "Nymph", "Primordial"],["God", "Titan", "Giant", "Monster", "Mortal", "Nymph", "Primordial"]);
let mortal = '';
if (kind == 'Mortal') mortal = tp.system.suggester(["Mereo", "King", "Villain"],["Mereo", "King", "Villain"]);
-%>
---
Number:
Date: <% tp.date.now("Do MMMM YYYY") %>
Sex: <% sex %>
Kind: <% kind %>
Mortal: <% mortal %>
---
# <% name %>
#RevC1
##Identity
- When:
- Where:
- Alt. Name:
- Greek Name:
- Latin Name:
- Kind: <% kind %>
- Sex: <% sex %>
- Father:
- Mother:
- Brothers:
- Sisters:
- Spouse:
- Children:
- Rule:
- Symbols:
- Transformation:
- Weapon:
- Abilities:
- Character:
- Constellation:
- Beat It By:
- Saved By:
- Stories: