|
| 1 | +--- |
| 2 | +title: "Template: Create an MOC Note with a Link Dashboard" |
| 3 | +--- |
| 4 | + |
| 5 | +Use this pattern when you want QuickAdd to create a new map-of-content note |
| 6 | +that already contains a live Base dashboard for both backlinks and outgoing |
| 7 | +links. |
| 8 | + |
| 9 | +## Why this pattern |
| 10 | + |
| 11 | +A Template choice can create the note and insert the dashboard in one step. |
| 12 | +The note stays markdown, while the embedded `.base` block gives you a live view |
| 13 | +of how that note connects to the rest of your vault. |
| 14 | + |
| 15 | +This works well for maps of knowledge, hub notes, topic notes, and evergreen |
| 16 | +indexes. |
| 17 | + |
| 18 | +## Setup |
| 19 | + |
| 20 | +1. Create a reusable `.base` template, for example |
| 21 | + `Templates/MOC Link Dashboard.base`: |
| 22 | + |
| 23 | +```yaml |
| 24 | +formulas: |
| 25 | + note_link: "file.asLink()" |
| 26 | +properties: |
| 27 | + formula.note_link: |
| 28 | + displayName: Note |
| 29 | + file.folder: |
| 30 | + displayName: Folder |
| 31 | + file.mtime: |
| 32 | + displayName: Updated |
| 33 | +views: |
| 34 | + - type: table |
| 35 | + name: Backlinks |
| 36 | + filters: |
| 37 | + and: |
| 38 | + - 'file.ext == "md"' |
| 39 | + - "file.hasLink(this.file)" |
| 40 | + - "file.path != this.file.path" |
| 41 | + order: |
| 42 | + - formula.note_link |
| 43 | + - file.folder |
| 44 | + - file.mtime |
| 45 | + - type: table |
| 46 | + name: Outgoing links |
| 47 | + filters: |
| 48 | + and: |
| 49 | + - 'file.ext == "md"' |
| 50 | + - "this.file.hasLink(file)" |
| 51 | + - "file.path != this.file.path" |
| 52 | + order: |
| 53 | + - formula.note_link |
| 54 | + - file.folder |
| 55 | + - file.mtime |
| 56 | +``` |
| 57 | +
|
| 58 | +2. Create a markdown template, for example `Templates/MOC Link Dashboard.md`: |
| 59 | + |
| 60 | +````markdown |
| 61 | +--- |
| 62 | +tags: |
| 63 | + - moc |
| 64 | +--- |
| 65 | + |
| 66 | +# {{VALUE:moc_title}} |
| 67 | + |
| 68 | +## Link Dashboard |
| 69 | + |
| 70 | +Use the view picker in this embedded base to switch between backlinks and |
| 71 | +outgoing links for this note. |
| 72 | + |
| 73 | +```base |
| 74 | +{{TEMPLATE:Templates/MOC Link Dashboard.base}} |
| 75 | +``` |
| 76 | + |
| 77 | +## Notes |
| 78 | + |
| 79 | +- Start linking this note to related ideas. |
| 80 | +```` |
| 81 | + |
| 82 | +3. Create a **Template** choice with settings like these: |
| 83 | + |
| 84 | +- **Template Path**: `Templates/MOC Link Dashboard.md` |
| 85 | +- **File Name Format**: `{{VALUE:moc_title}}` |
| 86 | +- **Create in folder**: your MOC folder, for example `MOCs` |
| 87 | +- **Open**: enabled |
| 88 | +- **File already exists behavior**: `Increment the file name` |
| 89 | + |
| 90 | +4. Run the Template choice and enter a title such as `Alpha Project`. |
| 91 | + |
| 92 | +## What you get |
| 93 | + |
| 94 | +QuickAdd creates a new markdown note with an embedded Base block. |
| 95 | +Inside the note: |
| 96 | + |
| 97 | +- `Backlinks` shows notes that link to the new MOC. |
| 98 | +- `Outgoing links` shows notes the MOC links to. |
| 99 | +- Both views use `this.file`, so the dashboard automatically scopes itself to |
| 100 | + the note that was just created. |
| 101 | + |
| 102 | +After the note exists, add links in either direction and the dashboard updates |
| 103 | +with the current graph around that note. |
| 104 | + |
| 105 | + |
0 commit comments