Templates - how to create, edit, and insert?

To create or define a template:

  • right-click a block bullet
  • choose Make Template
  • enter a template name and click Submit
    • note: should fix it to allow Enter to also submit the template name
    • note: should add a way to show existing template names, to check for duplicates, and potentially to allow for overwriting existing templates
  • the block and any children will now appear as an option in the list of templates

To rename a template:

  • click and edit the block property template: template_name

To edit an existing template:

  • locate the template and click the parent and/or child blocks to enter editing mode, make any needed changes
  • note that these changes will not propagate to existing instances of template (i.e. places where you previously inserted a copy of the template)

To use a template (i.e. insert a copy of the template):

  • in editing mode, type / and select Template
  • select the template you want to insert and type Enter
17 Likes

What am I doing wrong if after /templates --> Meeting Notes Template = nothing blank?

1 Like

I can’t follow the question, can you provide more detail about what you are doing, what you expect to happen, and what actually happens?

1 Like

Maybe you just make an empty template?
Recorded a GIF for this:

4 Likes

That is very useful, thank you will implement this

@Zhiyuan_Chen Thank you for this. I figured the same. I think where I am having trouble is I have forgotten where I put in the contents of the template. Is it between “PROPERTIES” and “END”? Do the contents have to be one the same line as properties?

Contents should not be put between “PROPERTIES” and “END”, and child blocks can also be part of the template.

Text of this page attached here:

---
title: Logseq
---

## some contents
:PROPERTIES:
:template: test2
:END:
### texts
1 Like

how can i delete a template?

1 Like

Just delete the template block

or removing the template property should work too

To find all templates

{{query (property template) }}
5 Likes

I believe the most convenient way to deal with templates is to create a dedicated file that will hold all the templates in one place (in my case I named it ls_templates.md. that way, I can easily find and edit my source templates.

note that templates can be structured bullets, but also be :PROPERTIES: (with one drawback : the order of properties is not saved) or a mix of both.

5 Likes

Completely forget all the time, some times I make templates, other times they are partially there and other times nothing. I feel like there should be a better way with templates.

4 Likes

Feature requests to improve templates:

  • when Logseq asks you to name a template, show the user a list of existing templates automatically so you can better choose a name that fits with your current templates.
  • have Logseq automatically create/reserve a Logseq page called “templates” that collects and displays existing templates, also making it easier for the user to find the “home” location of all templates so they can easily review and edit existing ones
10 Likes

Thank you Cobblepot,
I appreciate your detailed template info.
Do you have any other resources or know more about Template creation
How to work with the properties, what are the limitations in creating one.
any case studies to understand on how to create the properties and use them.

Cheers
Bimal

1 Like

And how do you do that? I tried with the obvious right click (on a Mac) but there is no delete option :frowning:

And also for modifying my templates (I have a fair share of beginner mistakes in them), I change the block. Yet when I go back to /template I find the good old version there again.
Any help is appreciated :star_struck:

Looking for this exact fix. Any ideas? Sometimes I want to add new fields after I’ve created my template. It’s a bit of a pain to go to each page and update it one by one

Agree with this, it’s hard to do it right at the first. bulk edit existing template/properties may be helpful.

Thanks