Template Plugin

For people using this plugin extensively, do you wish to have some more complex logic in your templates?

Some examples may be

  • Conditions based on value of your variables.
  • Loops
  • Adding, subtracting a variable
  • Yes
  • No
0 voters

Can you please explain why the template won't work?

---
hashtags: text
template_tags: {{ hashtags }}

---

Image:
Hashtags:  {{ hashtags }}

## LinkedIn

## Facebook
 
## Twitter

Thank you so much for this pull request @Imperial_Squid. I have decided to take this one step further and allow users to do even more with templates. This pull request motivated me to do this. I've created another pull request for that and included your commits in that pr (so, closing this one).

Pull Request: Allow users to have complex logic in templates by nishantwrp · Pull Request #79 · joplin/plugin-templates · GitHub

1 Like

I hope there can be a template system like ansible playbook or django
It looks very good, and the format is very similar to the current template.

Hi. I'm confused. I don't know how to start using this plugin (already installed it). I need simple step-by-step guide on how to build template. Can someone write it? Please:)

Sorry for late reply. The template doesn't work, as you can see from the screenshots.

Here is "Hashtags: {{ hashtags }}"

Here is "Hashtags: template_tags"

I use Joplin 2.11.11 version because it is the latest that work on Windows 7 (in later versions the Electron version used for Joplin was changed and become incompatible with Win 7)
Joplin 2.11.11 (prod, win32)

Sync Version: 3
Profile Version: 43
Keychain Supported: No

Revision: 6886f6f

Cursor Sync: 2.1.0
Favorites: 1.3.0
Journal: 1.0.14
JSheets: 1.1.3
Kanban: 1.0.7
Markmap: 1.4.1
MultiMarkdown Table Tools: 1.1.0
Note Tabs: 1.4.0
Note Variables: 2.0.0
Outline: 1.5.10
Simple Backup: 1.3.3
Suitcase: 0.3.2
Templates: 2.4.0

Just to make sure, after creating this template you're using it via Menu -- Tools -- Template -- ..., right?

I don't quite get what you're trying to achieve.


Template_tags : {{abc, cde}} is the problem in my opinion. Do you want to set tags when pasting from template? if so, you'd need to do

---
template_tags: {{hashtags}}
hashtags: text
---
## note body
hashtags: {{template_tags}}

Hope that helps,

Actually I tried to insert both template and the note that uses it in the same note :upside_down_face:

After your question I read the help and found that template should be a separate note tagged as "template". I've followed this way, and first created the note with the code you provided as a template, and then created new note from this template. However, for me this way also doesn't work, because in the note created from the template only the following content is reflected:

## note body
hashtags: 

i.e. after the "hashtags: " there is nothing, even if the template defines

---
template_tags: {{hashtags}}
hashtags: text

---

However, my initial idea was to use the hashtags specific for each note, defining the hashtags for each post in socials at the header of the note. Now I understand that the logic of the plugin is different and the template should contain the information that would be "cloned" in the created notes. And thus the hashtags could not vary for each note.

no, you can define tags on each new note pasted from template separately.

When you paste from template containing the code I provided previously there should be a pop-up window allowing you to specify the tags

1 Like

Thanks a lot for explaining this!
Indeed, the pop-up window appears and it is possible to insert tags that later appears in the note.
However, my workflow is completely opposite: first I create a note, then write the content (social post), and at the end proceed with insertion of tags.
Moreover, if later I decide to edit or change tags that will be used in the social post (not in the Joplin note), they will be changed only at the top of the note. But my idea was to define the tags once, and then insert in each note subsections (Linkedin, FB, Twitter) a reference to these tags that would allow to appear the same tags in subsections for each social network.

Finally, your plugin works and is useful. However, for this particular purpose I have in mind there should be another solution.
Thanks a lot for your explanations and examples!

1 Like

Can someone tell me how to start creating templates?

I'm using --- and {{ }} and template_title variable but nothing happens.

Even this wont work for me.:confused:

I'm using those plugins.

you may refer to official docs

in your case, you need to add tag "template" to start using a note as template

Hope this helps

This readme is not clear for me. I've copied this code:
image
and still nothing.

I'm asking for simple step-by-step for dummies. Just clear template of template will do the work.

  1. Import this note

test note template.jex (4.5 KB)

  1. Test that it works: Tools -- Templates -- Create note from template -- dropdown "test note template" -- OK
  2. edit this test template to your needs

Hope this helps

1 Like

It works! Thank you.

1 Like