I use dataview to make indexes of my notes. The problem I had was that it also included the filename as a column, which is long and ugly to look at in a table query. The file name was also the link to the note. I wanted a property in the note’s frontmatter to serve as the link and the file column to go away. Thankfully, someone in the discord server provided a link to an AI programming assistant, with a little bit of back and forth with the AI I finally managed to solve the problem, here is the solution in case anyone else wants to use it.
Making the unwanted Files(N) column go away:
Use the following css snippet and that pesky unwanted column vanishes. I named it hide-column.css
.mermaid .bodyTable thead th:first-of-type, .mermaid .bodyTable tbody td:nth-of-type(1) {
display: none;
}
.dataview.table-view-table th:first-child,
.dataview.table-view-table td:first-child {
display: none;
}
Accessing the frontmatter in a dataview query is easy; you just reference the particular property of the fontmatter. In my case the property I wanted to serve as the link to the note was “name:”, I have a bit of nostalgia for the 2E of D&D so I am building a vault just for the 2E. So here is the solution.
\```dataview
table link(file.name, <property>) as "Field Name", <property> as "Field Name", <property> as "Filed Name"
from "path"
where <conditions>
sort <property> asc
sorty <property> asc
\```
This will produce a three column table with the first column containing links to the notes using the frontmatter property specified, so that it only shows the data you want to see whilst still linking to your notes.