SubList with data view in MOC file

Things I have tried

The Moc file :

  • Frontend
    LIST WITHOUT ID "- "  + file. Link 
    FROM #frontend
     WHERE contains(file.folder, this.file.folder) 
     sort file.name asc
    
  • Backend
   LIST WITHOUT ID "- "  + file. Link 
 FROM #backend 
 WHERE contains(file.folder, this.file.folder) 
 sort file.name asc

What I’m trying to do

Im trying to create a MOC (map of contient ) with dataview
i need something like this :

  • frontend

    • [[html]]
    • [[Css]]
  • Backend

    • [[python]]
    • [[php]]

The Actual Behavior

  • the created list is in the level 3 (sub of sub list )
  • cannot show and hide the list

With regular dataview I think you can’t achieve that.

But I have a suggestion: use a special callout and place the dataview query inside.

  1. First step: create a css snippet for a special callout. You can use this code (removing the icon and the background… but you can use a color, if you want):
.callout[data-callout="special"] {
--callout-color: none;
}
.callout[data-callout="special"] .callout-icon {
display: none;
}
  1. Create a callout in this way:
> [!special]- Frontend
> ```dataview
LIST
FROM #frontend
WHERE contains(file.folder, this.file.folder)
SORT file.name ASC
> ```
2 Likes

Thanks for the suggestion, but I have two problems with this snippet

  • the callout is collapsible by default when switching to preview mode
  • the items under frontend is not a list

update :
it’s work only with minimal theme + without cssclass : max
i’m using dashboard++ so i need to use max attribut in YML

If you don’t want the default collapsed, change “-” to “+” - see docs

It works in default theme and Minimal theme (and with max class). If you have any conflict with other plugin or css snippet… well, that is another problem.

It works in all themes i tested, the conflict is with dashboard++ CSS Snippets
cssclass: dashboard
not my use case, but it’s the right answer to my question .

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