Property Type Defaulting to List

What I’m trying to do

I’d like the type in the below template to create a text type in front matter.
It seems to default to list. Is there a way to change this?

Things I have tried

<%*
  let title = tp.file.title
  if (title.startsWith("Untitled")) {
    title = await tp.system.prompt("Title");
    await tp.file.rename(title);
  } 
  
  tR += "---"
%>
created: <%tp.file.creation_date()%>
type: 
up: []
related: []
alias: 
tags:
---
# <%* tR += title %>
---
<% tp.file.cursor(0) %>

With a quick test, created and type were a text type; up and related were a list type using the above template. Try removing the brackets for those. e.g.

<%*
  let title = tp.file.title
  if (title.startsWith("Untitled")) {
    title = await tp.system.prompt("Title");
    await tp.file.rename(title);
  } 
  
  tR += "---"
%>
created: <%tp.file.creation_date()%>
type: 
up: 
related: 
alias: 
tags:
---
# <%* tR += title %>
---
<% tp.file.cursor(0) %>

Running this gives me a list type for the first four Properties.

Using your example precisely (square brackets removed), does make list types.

The exceptions being:
created: gets converted to a date format
alias: defaults to alias type
tags: defaults to tag type

What I’m looking for is how to have one default to text (rather than list).

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.