StS
August 30, 2025, 12:33pm
1
Hello Forum,
I use Page TOC .
If there is an empty list, it looks like:
→ I’d like to supress the popup when gk0wk-tiddlertoc-viewbuttonpopup-empty = ... keine Überschriften vorhanden ...
→ add condition to the code, but popup still appears…
What is wrong?
\whitespace trim
<div class="my-dots">
. . . . .
<%if [{gk0wk-tiddlertoc-viewbuttonpopup-empty}!match[... keine Überschriften vorhanden ...]] %>
<div class="my-hover-to-appear">
<span style="font-size: 1em; color: rgba(204, 204, 255, 0.6) !important; font-weight: 350">
<$page-toc tiddler=<<currentTiddler>> emptyMessage="... keine Überschriften vorhanden ..." scrollMode="start" h4="no" h5="no" h6="no" class="gk0wk-tiddlertoc-viewbuttonpopup" headerClassPrefix="gk0wk-tiddlertoc-viewbuttonpopup-" />
</span>
</div>
<%endif%>
</div>
Any help appreciated.
Thanks, Stefan
Would you be able to instead test for the presence of headings with a filter like this:
<%if "[<currentTiddler>search:text:regexp[^!+]] [<currentTiddler>search:text:regexp[\n+\n!+]]" %>
I suspect the filter in your <% if %> conditional needs to be surrounded by double-quote characters, like this: "
Part of your filter includes a space. I suspect the parser doesn’t realize that your filter includes some spaces.
StS
August 30, 2025, 6:52pm
4
@jpjerkins
Thanks for feedback - but it isn’t working.
StS
August 30, 2025, 6:52pm
5
Thanks @fastfreddy - works perfect!
Have you tried removing non-ASCII characters from your filter as well? I had to turn-off smart quotes on my iPhone because they made TW’s parser lose its mind.
StS
September 2, 2025, 3:33pm
7
No, I checked it with surrounded double-quote characters - like ["… keine Überschriften vorhanden …"].
This was not working…
set a variable containing your string and reference that in your filter <var>.