On Wednesday, September 9, 2020 at 10:44:05 PM UTC-7, Eric Shulman wrote:
>
> Instead of using a custom field, "purpose", you can just set the value in
> $:/info/url/search, like this:
>
Addendum:
When we modify the contents of $:/info/url/search, it creates a "real"
tiddler that overrides the default shadow version.
If you then save the document, that overridden shadow tiddler will be
retained. This will interfere with the the use of
the shadow tiddler value the next time you load the document.
To fix this, you can adjust the filter used in $:/core/save/all to exclude
the $:/info tiddlers, so that their shadow values
(which are automatically set) will always be used when reloading the
document.
Here's the definition of $:/core/save/all:
\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!
has[draft.of]]
\define saveTiddlerFilter()
[is[tiddler]] -[prefix[$:/state/popup/]] -[[$:/HistoryList]]
-[[$:/boot/boot.css]] -[type[application/javascript]library[yes]]
-[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]]
$(publishFilter)$
\end
{{$:/core/templates/tiddlywiki5.html}}
The saveTiddlerFilter() macro defines the list of tiddlers that will be
saved.
Note how it starts with "[is[tiddler]]" and then *removes* specific by
using filters with the "-" prefix.
Note also that the macro ends with "$(publishFilter)$".
This variable allows you to add filters to the list without having to
directly modify $:/core/save/all.
To do this, create a tiddler (e.g., "PublishFilter"), tagged with
$:/tags/Macro, containing
\define publishFilter() -[prefix[$:/info]]
That's it. Once this is defined, saving the file will automatically
exclude saving any tiddlers that start with $:/info, allowing the
auto-generated shadow tiddlers to be used whenever you reload the file.
Hope this make sense to you.
-e
Thus, to prevent the $:/info tiddlers from being saved, you would add:
-[prefix[$:/info]]
to the
\define link(suffix)
> <a title="Use this link to bookmark this site's purpose." href="
> https://intertwingularityslicendice.neocities.org/CJ_ProductReviews.html?context=$suffix$"
>
> style="text-decoration: none;">🔖</a>
> \end
>
> <div
> style="font-size:14px;line-height:1.7;margin-left:30px;color:dimgray;">
> <$radio tiddler="$:/info/url/search" value="?context=ProductReviews">
> {{TiddlyWiki Title 1}} </$radio> <<link "ProductReviews">>
> <br>
> <$radio tiddler="$:/info/url/search" value="?context=OffGridding">
> {{TiddlyWiki Title 2}} </$radio> <<link "OffGridding">>
> </div>
> Notes:
> * I retain the existing data value format, including the "?context="
> prefix. This keeps the content of $:/info/url/search consistent with the
> value that was automatically set.
> * I've turned the inline links (for bookmarking) into a macro definition
> using a parameter for the desired suffix, so that it only need to be
> specified once.
>
> By tagging the above tiddler with *$:/tags/SideBarSegment* and adding a
> field named *list-before*, with a blank value, the radio buttons will
> appear above the title in the sidebar. This eliminates much of the need
> for the "Fancy TiddlyWiki Title" tiddler. The rest of that tiddler is
> selecting which title to display, and applying styles to the TiddlyWiki
> title. This can be achieved directly in the $:/SiteTitle tiddler, like
> this:
> <div style="border-top:solid lightgray;">
> <div style="font-size:15px;line-height:1.5">Charlie's</div>
> <$reveal state="$:/info/url/search" type="match"
> text="?context=ProductReviews">
> {{TiddlyWiki Title 1}}
> </$reveal>
> <$reveal state="$:/info/url/search" type="match"
> text="?context=OffGridding">
> {{TiddlyWiki Title 2}}
> </$reveal>
> </div>
>
> Similarly, your conditional subtitle can be achieved directly in the
> $:/SiteSubtitle tiddler, like this:
> <div style="color:darkgray;font-size:90%;text-align:right;border-bottom:solid
> lightgray">
> - Version:
> <$list filter="[!is[system]!has[draft.of]!sort[modified]limit[1]]">
> <$view field="modified" format="date" template="YYYY-0MM-0DD
> 0hh12:0mmam" />
> </$list>
> - <br/>
> <$reveal state="$:/info/url/search" type="match"
> text="?context=OffGridding">
> <div style="color:gray;border-top:solid lightgray thin;text-align:left;
> ">
> //Easy, practical, and budget-friendly experiments/solutions for
> "light" grid independence.//
> </div>
> </$reveal>
> </div>
> Note that the first part (the version text) is only specified once, and is
> always displayed, regardless of which "mode" you are currently showing,
> and the second part (the $reveal) is only displayed when you are showing
> the "OffGridding" mode.
>
> I've probably left out some bits and pieces here and there, but hopefully
> this makes sense to you and you can fill in whatever I've missed without
> too much trouble.
>
> enjoy,
> -e
>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/0b733e06-5463-4995-85a6-bf6595f468b3o%40googlegroups.com.