# Change Journal template

**URL:** <https://community.silverbullet.md/t/change-journal-template/4360>\
**Category:** General\
**Created:** [September 9, 2026, 8:28am UTC](https://community.silverbullet.md/t/change-journal-template/4360 "2026-09-09T08:28:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![josemanu72](https://community.silverbullet.md/letter_avatar_proxy/v4/letter/j/d26b3c/32.png) [@josemanu72](https://community.silverbullet.md/u/josemanu72)\
**Post date:** [September 9, 2026, 8:28am UTC](https://community.silverbullet.md/t/change-journal-template/4360/1 "2026-09-09T08:28:37Z")

</div>

Hi,

I'd like to add a query to my journal template about which files have been modified on this (journal) day, or create a new template, no problem.

Need help with the query.

Thanks.

---

<div class="post-metadata">

**Author:** ![zeus-web](https://community.silverbullet.md/user_avatar/community.silverbullet.md/zeus-web/32/571_2.png) [@zeus-web](https://community.silverbullet.md/u/zeus-web)\
**Post date:** [September 9, 2026, 10:44am UTC](https://community.silverbullet.md/t/change-journal-template/4360/2 "2026-09-09T10:44:06Z")

</div>

Maybe another considerable (better?) approach is to add a top/bottom widget (or even one of the new "dockable views"), which applies only to your journal pages? That way you don't need to change the template.

See [Widget](https://edge.silverbullet.md/Space%20Lua/Widget#Creating%20custom%20top/bottom%20widgets)

Just a raw exampe:

````auto
```space-lua

-- priority: -11
event.listen {
  name = "hooks:renderBottomWidgets",
  run = function(e)
    if not editor.getCurrentPage():startsWith("Journal/") then
      return
    end
    
    local changeslist = query[[
            from index.tag "page" 
            limit 10
            order by lastModified desc
          ]]

    if #changeslist >0 then
       return "# Last 10 changes:\n" .. markdown.objectsToTable(changeslist) 
    end
    
  end
}
```

````

---

<div class="post-metadata">

**Author:** ![josemanu72](https://community.silverbullet.md/letter_avatar_proxy/v4/letter/j/d26b3c/32.png) [@josemanu72](https://community.silverbullet.md/u/josemanu72)\
**Post date:** [September 10, 2026, 6:22am UTC](https://community.silverbullet.md/t/change-journal-template/4360/3 "2026-09-10T06:22:12Z")

</div>

Great!,

How could I change the query to show pages where "lastModified" is equal to Journal "date" at the frontmatter(?).

Thanks.

---

<div class="post-metadata">

**Author:** ![Mike](https://community.silverbullet.md/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@Mike](https://community.silverbullet.md/u/Mike)\
**Post date:** [September 10, 2026, 7:06am UTC](https://community.silverbullet.md/t/change-journal-template/4360/4 "2026-09-10T07:06:31Z")

</div>

You can get the "date" from the frontmatter with `editor.getCurrentPageMeta().date`

To get the lastModified date, you need to chop of the time indication, for instance `string.sub(editor.getCurrentPageMeta().lastModified,1,10)`

Then the query is something like:  
`${query[[from p = index.contentPages() where string.sub(p.lastModified,1,10) == editor.getCurrentPageMeta().date]]}`

---

<div class="post-metadata">

**Author:** ![josemanu72](https://community.silverbullet.md/letter_avatar_proxy/v4/letter/j/d26b3c/32.png) [@josemanu72](https://community.silverbullet.md/u/josemanu72)\
**Post date:** [September 10, 2026, 10:32am UTC](https://community.silverbullet.md/t/change-journal-template/4360/5 "2026-09-10T10:32:42Z")

</div>

> [@Mike](#):
>
> ${query[[from p = index.contentPages() where string.sub(p.lastModified,1,10) == editor.getCurrentPageMeta().date]]}

You made my SB better! 😃

Thanks!.
