Is it possible to exclude files from "linked mentions"?

What I’m trying to do

I have two files that serve as indexes and contains links to all other files in the vault. I’d like these files to be excluded from the Linked Mentions panels–I don’t need to see them on every page.

Things I have tried

I added these files to the “excluded” files area in the settings.

I don’t think it’s feasible :thinking:
(But as often, I could be wrong :sweat_smile: )

… But you could collapse the linked mentions section, by clicking on it (so you wouldn’t see all that anymore) :woman_shrugging:

I’ve got an idea… Not sure it’s a good idea, but it’s an idea. What if you added something to a special note which linked to those you want to hide, which were possible to target through CSS, and then hid every element which had that element as a child element?

So I set forth adding my favorite anchor, a tag, only to discover that the linked mention don’t do any parsing of the search result it presents. In fact there is nothing specific to each search element for us to target the CSS to:

<div class="tree-item search-result" draggable="true">
   <div class="tree-item-self search-result-file-title is-clickable">
      <div class="tree-item-icon collapse-icon" style="">
         <svg> ...  </svg>
      <div class="tree-item-inner">t79314 hider file</div>
      <div class="tree-item-flair-outer"><span class="tree-item-flair">1</span></div>
   <div class="search-result-file-matches" style="">
      <div class="search-result-file-match">
         <span>#linkedMentionHide </span><span class="search-result-file-matched-text">[[f79314 Exclude files from linked mention]]</span>
         <span> &lt;a href="#teaser"&gt;teaser&lt;/a&gt;</span>

In other words, to be able to hide a specific linked mention you need for something to target using CSS, and currently there is nothing to target. So to be able to hide one entry, you’ll need either a plugin or some javascript code to scan the .backlink-pane part of the DOM continuously (or each time it updates) and either directly hide the part where a “.tree-item-inner” has content matching your file name, or you need to tag it somehow to make it disappear using CSS.

Related (highly popular, probably not well described…) FR:

this is a bit over my head. If I tagged the index files #indexFile, how would I create a snippet that filtered them from the linked mentions list?

I’m not sure I’m following this. Are you saying you’re currently able to filter the backlinks panel, just not with the criteria you want? Or this is the feature request?

No, if it had detected the tag it would be easy to do this. But it doesn’t, and that makes it dependent on javascript or some other way of tagging the linked mention you want to hide.

You’re able to search in the backlink pane, and exclude a given file. But as far as I know you’ll need to repeat that over and over again. You can’t save the search, or set it to keep it for later.

I wrote the previous answer without actually testing it, and it turns out that the backlink search keeps tags of what it searches even if you close the side panel or switch to other windows.

So you could open the backlinks pane, hit the search icon and do `-“File you don’t like”, and this will stay until you close the search window again…

I think the FR post is not easily understood because the regex example is toning out the rest of the text.

  • EDIT. In the meantime I rephrased the request. Would be nice to have people on board to add their two cents’ there.

Yes, you can filter backlinks and local graph (not using the global one, maybe you can do it there as well) but the problem is that for each file you’d need to specify the filename you are currently in. When you switch files, you’d need to update the filename. So we would need a dynamic solution, a variable like {{currentFile}} or {{activeLeaf}} or something.

I would like to ask if it is possible to exclude words from linked mentions?

For example

The http is useless.