Is it possible to filter, search, or refine the Linked Mentions block?

Hi everyone!

I'm quite new to SilverBullet. First of all, I'd like to say a huge thank you to the author for creating such an amazing tool — its features and capabilities are truly impressive!

I rely heavily on the Linked Mentions block to connect my pages and navigate back links. However, for some of my more frequently referenced pages, the Linked Mentions section has grown quite large, making it difficult to find specific entries.

Is there a way to filter or search within the Linked Mentions block? For example, filtering entries by tag, by another linked page, or simply running a quick search/filter on the list?

I feel like this would completely solve my issue with growing backlink lists.

Thanks in advance for any help or tips!

Linked Mentions is a widget, generated by the function widgets.linkedMentions(pageName), which you can find in Library/Std/Widgets/Widgets

You could overwrite this function to use some kind of filtering in the query.

Here's the Linked Mentions override I use. Simply place the code in a space-lua block in any page and it will supercede the default Linked Mentions. I tweaked the template for each Linked Mention entry. You can easily modify the query to apply your own filtering and sorting

-- priority: 10
widgets = widgets or {}

local mentionTemplate = template.new [==[
*[[${_.ref}|${_.ref}]]*:
> ${_.snippet}

]==]

-- configuration schema
config.define("std.widgets.linkedMentions", {
  type = "object",
  properties = {
    enabled = schema.boolean(),
  }
})

-- configuration default values
config.set("std.widgets.linkedMentions", {
  enabled = true,
})

function widgets.linkedMentions(pageName)
  pageName = pageName or editor.getCurrentPage()
  local linkedMentions = query[[
    from index.tag "link"
    where _.page != pageName and _.toPage == pageName
    order by _.page desc, _.pos
  ]]
  if #linkedMentions > 0 then
    return widget.new {
      markdown = "# Linked Mentions\n"
        .. template.each(linkedMentions, mentionTemplate)
    }
  end
end
```