I have set up a file called “Global” in a root directory called “global”. I have defined my global values such as “lastMedium” in the front matter. I can now manually update them (meaning: adding 1 for each new note) via databaseTable with something like:
```databaseTable sources: - type: directory path: global fields: - name: lastMedium type: number
I can then refer to this variable via dataview with e.g.:
lastmedium:: `$=dv.page("global/Global").lastMedium` lastmediumName:: `="Hallo, " + this.lastmedium`
So far, so good.
I have different sets of files with sequential IDs which do not match their filenames. I want to set up global variables that should be automatically referred to and incremented when creating a new note. Some of these variables must be calculated depending on values (such as title, or author name) in the note.
The logical next step would be to have
- a template (via Templater?) that
- updates my global file (= adds 1 to lastMedium) and
- creates a new note with referrals to the current lastMedium, or/and
- a button that
- updates the global file,
- creates a new note or
- updates the current note.
How can I achieve this?