# Different daily template based on day?

**URL:** <https://org-roam.discourse.group/t/different-daily-template-based-on-day/1445>\
**Category:** How To\
**Created:** [April 5, 2021, 8:59pm UTC](https://org-roam.discourse.group/t/different-daily-template-based-on-day/1445 "2021-04-05T20:59:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![spolakh](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@spolakh](https://org-roam.discourse.group/u/spolakh)\
**Post date:** [April 5, 2021, 8:59pm UTC](https://org-roam.discourse.group/t/different-daily-template-based-on-day/1445/1 "2021-04-05T20:59:25Z")

</div>

Hi! Wondering if someone already figured out how to customize `org-roam-dailies-find-today` etal to use a different `org-roam-dailies-capture-templates` template depending on the day of the week \ day of the month \ …?  
Defining multiple `org-roa-dailies-capture-templates` doesn’t seem to help much since it seems like `org-roam-dailies-find-today` just uses whatever template is the first in that list?

---

<div class="post-metadata">

**Author:** ![spolakh](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@spolakh](https://org-roam.discourse.group/u/spolakh)\
**Post date:** [April 5, 2021, 11:06pm UTC](https://org-roam.discourse.group/t/different-daily-template-based-on-day/1445/2 "2021-04-05T23:06:48Z")

</div>

Ok, I think I’ve hacked up _some_ solution to this. My emacs-fu is super basic though so would be glad if someone can simplify this a bit. Basically, this is based on `org-roam-dailies-find-today` using the first of `org-roam-dailies-capture-templates` (as I seem to have correctly figured out in the beginning). So we define our own `me/org-roam-dailies-find-today` function that re-binds `org-roam-dailies-capture-templates` in a `let` scope and then calls `org-roam-dailies-find-today`

```auto
  (defun spolakh/org-roam-dailies-find-today ()
    (interactive)
    (spolakh/org-roam-find-day-wrapper 'org-roam-dailies-find-today (spolakh/daily-template-text-for-day 0))
    )

  (defun spolakh/org-roam-find-day-wrapper (finder-function custom-text)
    (let ((org-roam-dailies-capture-templates (spolakh/compile-daily-template custom-text)))
      (funcall finder-function)
      ))

  (defun spolakh/daily-template-text-for-day (offset-days)
    (let* (
           (newts (ts-adjust 'day offset-days (ts-now)))
           (dow (ts-dow newts))
           ; 0 is sunday
           (text-with-weekly (if (= dow 0) "\n\n[[roam:§ PRIVATE/Nice Things This Week]] 1: 2: 3:" ""))
           (last-day-this-month (calendar-last-day-of-month (ts-month newts) (ts-year newts)))
           (d (ts-day newts))
           (is-last-sunday (and (= dow 0) (< (- last-day-this-month d) 7)))
           (text-with-monthly (if is-last-sunday (concat text-with-weekly "\n\n[[roam:§ PRIVATE/Nice Things This Month]] 1: 2: 3:") text-with-weekly))
           )
      text-with-monthly)
    )

```
