-
My Setup And ProblemBased on my personal needs, I have created a categorized overview of all my tasks. Using the Obsidian Tabs plugin (https://github.com/xhuajin/obsidian-tabs) by @xhuajin, I can switch between the categories Timeline, Tags (🏷️ Tag), Projects (🔗 Project), Mentions (👤 Person, 👥 Group, 🏢 Company) and Comments (subitems for each task starting with datestamp). In my system, mentions and projects are [[backlinks]] within the task description. The tasks are grouped accordingly in each tab category. Within each individual group, the tasks contained therein are sorted by happens date. What I am still missing, however, is a sorting of the groups themselves. I would like to sort all groups that have at least one task with a happens date to the top of the list so that I can focus on them more quickly. My tasks are also highlighted using custom CSS according to a user-defined color scheme (mint = undated, yellow = in progress, orange = today, red = overdue, green = done). Does anyone have any idea whether this sorting I want to do using The simplest solution to put the tasks with happens date at the beginning is to put the happens date Failed Solution Approach 1
I have also already tried to write each group within the function in an object with a specific sort key. For each task, the system then checks whether such a group is already contained in the object and which sort key it has. I can then put this sort key Failed Solution Approach 2
It would be really great if anyone here had a helpful idea. I hope you do too. ScreenshotSample Tasks
FilesTasklist CSS-Snippet.txt
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Please look at the Custom Grouping docs page. There is a section explaining using hidden text in markdown comments to control the sorting. That is what you need to do. |
Beta Was this translation helpful? Give feedback.
Thank you very much for the hint with
tasks.queryAll
. I was actually unaware of this function and seem to have overlooked it in the documentation. After a few attempts I was able to create a working script. The result is now exactly what I wanted.I first filter out all mentions that come from tasks that have a happens date using
tasks.queryAll
. In thegroup by function
procedure, the mentions of each task are then matched with myprioMentions
array.For some reason, neither the check via
includes
nor viasome
works with myprioMentions
array. Only if I convert the array into a string usingjoin
and then check it usingindexOf()
does work. It's just a blemish, but at least it works.Thank…