Skip to content

How to handle year and date in template? #254

Answered by myshevchuk
wztdream asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

no, there is no such keyword. You are welcome to submit a feature request. It will take some time though because I'll be quite busy until the end of next week.

You can achieve what you want with LISP expressions in your template. Read the documentation of org-capture-templates.
You can have a function, for example, which takes both the keywords and then returns a non-empty result if one of the fields is non-empty. It'd look something like this:

(defun my-orb-year-or-date (keyword1 keyword2)
  (if (string-empty-p keyword1)
    keyword2
  keyword1))

Adjust it to your needs to handle the conversion of date to year. And then in the templates:

(setq org-roam-capture-templates
'(("r" "refer…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@wztdream
Comment options

Answer selected by wztdream
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants