What I’m trying to do
I’d like my homepage to have a button that, when clicked, creates a document with a templater template in a specific subfolder. I basically want a shortcut so that I can just click to make a note in a subfolder with specific information contained in the template like weather and so on.
Things I have tried
I have tried to adapt some codes from others via copy-paste that apparently are more dataview oriented. For reference, this is my current homepage code:
---
editor-width: 100
banner: "![[IMAGE]]"
cssclasses:
- hide-properties
sticker: lucide//home
banner_x: 0.5
---
```dataviewjs
// === CONFIG ===
const dreamFolder = "Dream Journal ";
const divinationFolder = "Divination Logs ";
const dateFormat = "yyyy-MM-dd";
// === BUILD PATHS ===
const today = dv.date("today");
const dreamPath = `${dreamFolder}${today.toFormat(dateFormat)}`;
const divinationPath = `${divinationFolder}${today.toFormat(dateFormat)}`;
// === BUTTONS ===
let content = "";
content += `<a class="internal-link elegant-btn ready" href="${dreamPath}">📖 Dream Journal </a>`;
content += `<a class="internal-link elegant-btn ready" href="${divinationPath}">🔮 Divination Log </a>`;
// === OUTPUT ===
dv.el("div", `<div class="breadcrumbs-wrapper">${content}</div>`);
```
```search-bar
show recent files
```
```contributionGraph
title: Note Contributions
graphType: month-track
dateRangeValue: 1
dateRangeType: LATEST_MONTH
startOfWeek: 0
showCellRuleIndicators: true
titleStyle:
textAlign: center
fontSize: 15px
fontWeight: normal
dataSource:
type: PAGE
value: ""
dateField:
type: FILE_MTIME
filters: []
countField:
type: DEFAULT
fillTheScreen: false
enableMainContainerShadow: false
cellStyleRules: []
```
---
```dataviewjs
// Create container
let container = dv.el("div", "", {cls: "tag-cloud-container"});
// Get all pages
let pages = dv.pages();
// Flatten all tags across all pages
let allTags = [];
for (let page of pages) {
if (page.file.tags) {
allTags.push(...page.file.tags);
}
}
// Count occurrences of each tag
let tagCounts = allTags.reduce((acc, tag) => {
acc[tag] = (acc[tag] || 0) + 1;
return acc;
}, {});
// 🔹 Sort tags alphabetically
let sortedTags = Object.keys(tagCounts).sort((a, b) => a.localeCompare(b));
// Render each tag as clickable link
for (let tag of sortedTags) {
let count = tagCounts[tag];
let link = dv.el(
"a",
`${tag} (${count})`,
{
href: `obsidian://search?query=${encodeURIComponent(tag)}`,
cls: "tag-chip"
}
);
link.style.margin = "2px"; // add spacing
container.appendChild(link);
}
However, this creates a note that does not follow the template and is not contained within any folder. I am still pretty new to customizing my Obsidian, so I might have bitten off more than I can chew. Please help!