Problem on exiting my online search site

Hi everyone

Índice central — giffmex.org/b/ is a project I am working on, a site to search all the pages in my website.

But my users will no doubt be confused by the alert message when they try to exit/close the page, that changes will not be saved. Using the searches turns the save-wiki button red, so the file is expecting the user to save changes. But that button is also the download wiki button. So there is no way to either avoid the alert.

The problem is created by my four variations of @Mohammad 's KISS macro, links below. But Mohammad’s original macro (here) also creates the same behavior.

$:/KISS List-Search Macro fecha
$:/KISS List-Search Macro formato
$:/KISS List-Search Macro tema
$:/KISS List-Search Macro titulo

The old list-search macro by Tobias Beer doesn’t do this. But then, Mohammad’s wonderful KISS macro has versatility and advantages over Tobias’ macro that I would prefer not to give up. So I am wondering if there is a way to update KISS so that it doesn’t create this behavior. I appreciate any help I can get. I already invested a lot of time in this and am kicking myself for not anticipating this hiccup. Blessings.

The list of tiddlers that cause the wiki to be marked as “dirty” (i.e., show a red save-wiki button) is defined by a filter in the $:/config/SaverFilter shadow tiddler. This filter begins with [all[]], and then subtracts certain tiddlers for which changes should be ignored.

The default shadow definition is:

[all[]] -[prefix[$:/HistoryList]] -[prefix[$:/StoryList]] -[status[pending]plugin-type[import]]
-[[$:/isEncrypted]] -[[$:/UploadName]] -[prefix[$:/state/]] -[prefix[$:/temp/]]

This shadow tiddler can be customized to exclude other tiddlers simply by subtracting other tiddler filter runs. For example, to exclude any tiddlers that are using your variations of the KISS macro, you could add:

-[has:field[search]]

to the $:/config/SaverFilter filter definition.

Note that these excluded tiddlers will still be saved when you press the save-wiki button… they will just be ignored when deciding if the wiki should be considered as “dirty”. If you also want to prevent those tiddlers from actually being saved, then do this:

Create a tiddler (e.g., “MyPublishFilter”), tagged with $:/tags/Macro, containing:

\define publishFilter()
-[has:field[search]]
\end

The publishFilter macro will be automatically applied by the TWCore saveTiddlerFilter() macro, which is defined in $:/core/save/all, and used by the $:/core/templates/tiddlywiki5.html template to construct and save the file content.

enjoy,
-e

3 Likes

Thank you so much, Eric! That worked great! And thank you for the detailed explanation.