Template code working only half of the time

If your query stops showing stuff, or doesn’t show the new version of changes, you could just close that quote note and open it again. Another version is to use the page history, and go back and forth again to the same quote file. A slightly more advanced alternative is to use either Templater or QuickAdd to trigger a command to rebuild the view. Here are two links to threads discussing how to do this using QuickAdd or another one using Templater.

If your properties doesn’t show, or you get a message on invalid frontmatter/yaml, I’ve found that easiest way is simply to move the lower code fence around to see where it doesn’t accept my suggestion for properties. If you start with moving the lower code fence, aka ---, into the middle of your frontmatter, and it displays correctly, then your error is in the lower half. If it doesn’t show, it’s between the fence and the start. In either case, move the fence half way into the offending section, and repeat until you find the line you think is the culprit.

After locating the line, move the fence back to its starting point, move the offending line out of the frontmatter, and see if the rest is OK. And now, you can focus on the line trying to understand why it’s not accepted. Often it is due to a strange symbol not being interpreted as text, like the colon, :, and you solve it by adding straight quotes around the value, " ... ".

1 Like