-
-
Notifications
You must be signed in to change notification settings - Fork 4
Troubleshooting
Use this page when a view is blank, the wrong files match, Bases rows are missing, or JavaScript fails.
Check these first:
- The active note matches the view rules.
- The view is above broader matching views in settings.
- The HTML template has balanced logic tags:
{% if %}with{% endif %},{% for %}with{% endfor %}. - Open Developer Console and check for JavaScript errors.
- Temporarily disable the view's JavaScript.
Add a tiny marker to confirm the template runs:
<div>Custom Views rendered {{file.path}}</div>Custom Views uses the first matching view. Move the intended view higher or make the earlier rule more specific.
Print the raw value near the top of the template:
<pre>{{file.properties}}</pre>
<pre>{{cover}}</pre>
<pre>{{artists}}</pre>Then verify the property name and shape in the note frontmatter. Lists need indexes or joins:
{{cover[0]}}
{{artists|join:", "}}Use expression syntax in conditions, not pipe filters.
Instead of:
{% if row.values.artists|length > 1 %}Use:
{% if row.values.artists.length > 1 %}For album track artists, hide the row when there is only one artist or when the track artist is already the album artist:
{% set trackArtists = row.values.artists %}
{% if trackArtists.length > 1 and not trackArtists.contains(artists[0]) %}
<div class="album-track-artists">{{trackArtists}}</div>
{% endif %}Use expression syntax:
{{file.basename.replace(/.*\s*–\s*/, "")}}Or pipe filter syntax:
{{file.basename|replace:"/.*\s*–\s*/":""}}Make sure the dash is the same character. Ritviz – Mimmi uses an en dash, not a hyphen.
Add debug output:
<pre>rows: {{bases.Songs.rowCount}}</pre>
<pre>error: {{bases.Songs.error}}</pre>Then check:
- The YAML block starts with
views:. - Indentation is valid YAML.
- The view name and access name are not confused.
{% base "Songs" %}givesbases.Songs. - The filtered property has the expected type.
-
thispoints to the current note.
This filter only works when song notes have an album property that links to the current album note.
Example song frontmatter:
---
album:
- "[[Music/Love and Machines/Love and Machines|Love and Machines]]"
track: 1
artists:
- "[[Artist Name]]"
---If your song files store album names as plain text instead of links, change the Base filter to match your data shape.
Check:
- Allow JavaScript execution is enabled.
- The script has no syntax error.
- DOM queries are scoped to
thisand run after the template exists. - External fetches are not blocked or failing.
Use this temporary line:
console.log("Custom Views JS ran for", this);Remove the log after debugging.
Canvas sampling can fail for remote images because of CORS. Use crossorigin="anonymous" on images when possible and keep a fallback color.
<img class="album-cover" src="{{cover[0]}}" crossorigin="anonymous" alt="{{file.basename}}" />Wikilinks render best in body content, not inside raw attributes. For links from Bases rows, prefer:
<div>{{row.file.link}}</div>
<div>{{row.values.artists}}</div>Try:
- Reduce JavaScript work.
- Remove large remote fetches from initial render.
- Move related-file logic into a Bases query.
- Avoid rendering huge
{{file.content}}sections inside already-heavy views.