Alrighty, after a full nights rest and a little bit of time to give it some thought, I think I have a better idea of what I had originally wanted to ask.
What I was looking for was a widget or macro that can be placed along with other widgets / macros, that can either piggyback off what they are looking for, ie using a list widget to filter for tiddlers that are tagged woth Contents, or be given the same paramaters to look for, and if there are none, the additional widget using the same filter allows you to add in an emptyMessage if there aren’t any results of the filter.
Unfortunately filtering for a blank text would not work because of the inclusion of the widgets inside, unless you used regex to filter for things prefixed with <<
or <$
The intent is adding an emptyMessage to widgets that do not have it without having to modify the widget itself, like giving it an addon almost, and what brought this thought to me in the first place was wanting to add placeholder text to a toc if no tiddlers were tagged with what it was filtering for.
I should mention that the usage of wikitext such as wikilinks or transclusion of text from another tiddler would be wanted, where you can customize each use to have either the same default text or custom placeholder text.
For instance, if I had a toc that is looking for the tag Contents
you could do something like
<div class="tc-table-of-contents">
<<toc-selective-expandable tag:"Contents">>
</div>
<<emptymessage filter:"[tag[Contents]count[]match[0]]"
text:"""
{{A tiddler with some text}}, a {{Contents||button to add a tiddler tagged fo fill the filter}}, etc.
""">>
ErikShulman’s alternative to what I proposed was able to achieve that for the toc aspect, however I don’t know for how many other uses it could be used for. Considering its just a filter for a tag, probably most widgets.
I’m just trying to think of where that wouldn’t be enough because J do want to find the most modular way to do this, rhe way that works best with the other widgets both in the core and potentiall with plugins.