Sort the files based on ID (not title) which is more suitable for Zettelkasten

What I’m trying to do

Imagine I’m reading a book and creating notes, with each note saved as a separate .md file. If I opt for titles like “Purpose of Fleeting Notes in Zettelkasten” and “How to find meaningful connections in Zettelkasten,” a significant problem arises.

The problem is this: when I view these files in Obsidian, they are sorted either alphabetically or by date, which doesn’t meet my needs. I require a way to sort the notes based on a value, such as an ID, so that I can arrange them chronologically based on the order I took the notes.

You might suggest using a format like “2023-10-29-001-Your VERY Long Title.” However, as you can see, this approach makes the titles cumbersome. I appreciate your assistance in advance.

You may suggest using 2023-10-29-001 as title, but that is self-explanatory and NOT GOOD for searchability.

If you want to use the built-in file explorer, then currently you’re limited to using the file name, and/or creation/modification times. Aka you need to include something at the start of the file name to use for sorting.

If you build your own queries displaying the files, think automatic MOC’s, you can make that query sort on whatever criteria you want based upon metadata in the file.

It’s also an option to have the file names be ID’s, and having the title in the properties and as an alias. This would allow you sort the files correctly, but you wont see what the file is about, except when you’re looking at links using the aliases, either through queries or links with the alias.


Some years ago I decided to implement my own date format, due to similar length constraints on the file names, so your “2023-10-29 Your VERY long title”, is usually typed as `NA29 Your VERY long title", since my dataformat only uses 4 character for a full date after 2000.

Details on my date format

My date format consists of 3 different groups:

  • Year – The first character denotes the year using a base 36 number, so 5 would mean 2005, and N is current year 2023, since N is the 14th character in the alphabet and there would be 9 numbers before that (9 + 14 = 23 )
  • Month – The second character denotes the month using a base 13 number. So 1 - 9 is January through September, and A is October, B is November and C is December
  • Day of month – The third and fourth characters denote the day of month using two characters with a leading zero for those below 10. It could have been a base 32 number, but I decided it would be a lot easier to read the dates when using two characters.

I’m using this date format in my daily journals and other stuff needing a date to be attached, and my templates will add this to the title and at the same time add a date property with the ISO date so that in dataview queries (and some other plugins) the date will also be readily available in an “ordinary” format.

This date format does then allow my file name to both be sortable by date/ID, and have a descriptive text without wasting too much space including a full ISO date.

1 Like

Thank you so much. While not very reading-friendly, I liked the general idea of your system. However, I have a question about the “year” in your format:

2000→0
2001→1

2005→5
2006→A
2007→B

2023→N

2035→Z

What about other years? [2036, ∞)

2009 → 9, 2010 → A, …

When I started this format years ago, 2036 was far ahead in the future… however one could easily say something like if the first character is Z, we shift the offset and start over. One could also possibly use other characters, or similar.

In short, that’s something for future us to worry about. :slight_smile:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.