# Using template file with file+head+olp

**URL:** <https://org-roam.discourse.group/t/using-template-file-with-file-head-olp/2959>\
**Category:** Troubleshooting\
**Created:** [January 20, 2023, 4:02am UTC](https://org-roam.discourse.group/t/using-template-file-with-file-head-olp/2959 "2023-01-20T04:02:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![troam](https://avatars.discourse-cdn.com/v4/letter/t/cc9497/32.png) [@troam](https://org-roam.discourse.group/u/troam)\
**Post date:** [January 20, 2023, 4:02am UTC](https://org-roam.discourse.group/t/using-template-file-with-file-head-olp/2959/1 "2023-01-20T04:02:17Z")

</div>

Hello,

I find that specifying a template file doesn’t work. I get an org file with only the Log heading, with the capture going under the heading.

```auto

        ("y" "Daily Log Entry" entry "** %<%I:%M %p>: %?"
         :target (file+head+olp "%<%Y-%m-%d>.org"
                               (file "~/org/roam/templates/daily_template.org")
                                ("Log"))
         :unnarrowed t)

```

However, when I have a string specifying the template contents like as this:

```auto
        ("y" "Daily Log Entry" entry "** %<%I:%M %p>: %?"
         :target (file+head+olp "%<%Y-%m-%d>.org"
                              "#+title: %<%Y-%m-%d>\n\n* Short List\n\n* Log\n:PROPERTIES:\n:VISIBILITY: children\n:END:\n"
                                ("Log"))
         :unnarrowed t)

```

the file is populated with that string.

Is it not possible to use a template file with file+head+olp?

---

<div class="post-metadata">

**Author:** ![de\_ramon](https://avatars.discourse-cdn.com/v4/letter/d/ee59a6/32.png) [@de\_ramon](https://org-roam.discourse.group/u/de_ramon)\
**Post date:** [October 10, 2025, 5:34am UTC](https://org-roam.discourse.group/t/using-template-file-with-file-head-olp/2959/2 "2025-10-10T05:34:53Z")

</div>

Hi @troam

I’m also interested in a single daily file, or one per year.

Any success using datetree + olp?

Regards, Ralf

---

<div class="post-metadata">

**Author:** ![akashp](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/akashp/32/1383_2.png) [@akashp](https://org-roam.discourse.group/u/akashp)\
**Post date:** [October 11, 2025, 7:46pm UTC](https://org-roam.discourse.group/t/using-template-file-with-file-head-olp/2959/3 "2025-10-11T19:46:51Z")

</div>

ofcourse it is possible - I do it too and I think its a very rational way to organise.

```auto
(add-to-list 'org-roam-dailies-capture-templates
	     '("d" "day-entry" entry
	       "* %<%d-%m-%Y> \n\n%?"
	       :target (file+datetree "%<%Y>.org" month)
	       :empty-lines 1
	       :unnarrowed t
	       :jump-to-captured t))

```

Does this work for you? If you use the latest version of org-roam it will put id on every captured entry. We can ofcourse even tune this to our desire.

---

<div class="post-metadata">

**Author:** ![de\_ramon](https://avatars.discourse-cdn.com/v4/letter/d/ee59a6/32.png) [@de\_ramon](https://org-roam.discourse.group/u/de_ramon)\
**Post date:** [October 14, 2025, 9:48pm UTC](https://org-roam.discourse.group/t/using-template-file-with-file-head-olp/2959/4 "2025-10-14T21:48:35Z")

</div>

Hi @akashp ,

thanks for your fast reply. Meanwhile I did the setup on myself:

> ```auto
> #+begin_src emacs-lisp;; Caution: creates timestamps with Dayname: 2025-10-10 Friday;; (setq org-datetree-add-timestamp-format “%Y-%m-%d”)
> 
> (setq org-roam-dailies-capture-templates
> '((“d” “default” plain
> “ **** %?”
> :target (file+datetree “%<%Y>.org” day))))
> #+end_src
> 
> ```

I also creates a script to convert my old dailies into the new file-format [yyyy.org](http://yyyy.org):

[org-roam\_convert\_dailies.py](https://codeberg.org/de_ramon/org-roam-stuff/src/branch/main/org-roam_convert_dailies.py) on CodeBerg cu, ramon
