On Sunday, August 2, 2020 at 3:15:02 PM UTC-7, Rafael Oliveira wrote:
>
> it'd be nice if I could add a condition that relies on the tag used. The
> pseudocode would look like:
> \define lingo-base() $:/language/Search/
> if ( tag === "$:/tags/AdvancedSearch" ) {
> <<lingo Filter/Hint>>
> }
>
> <div class="tc-search tc-advanced-search">
> <$edit-text tiddler="$:/temp/advancedsearch" type="search" tag="input"
> focus={{$:/config/Search/AutoFocus}}/>
> <$list filter=
> "[all[shadows+tiddlers]tag[$:/tags/AdvancedSearch/FilterButton]!has[draft.of]]"
> ><$transclude/></$list>
> </div>
> This way I'd only see the text when the tag used is the original one. Is
> something like this possible?
>
The actual wikitext syntax for the above pseudo-code is:
<$list filter="[<currentTiddler>tag[$:/tags/AdvancedSearch]]">
<<lingo Filter/Hint>>
</$list>
Unfortunately, that won't achieve the results you want, as that tag will
likely still be present, since you've *added* the $:/tags/SideBarSegment
tag.
The solution is the recognize that in the $:/AdvancedSearch, the Filter
tiddler appears *in a tab*, while as a SideBarSegment, it will be
"stand-alone". When a tiddler is shown in a tab, the <<tabs>> macro
automatically defines a variable, <<currentTab>>, which is available from
within each tiddler shown in that "tab set".
Thus, you could write the following:
<$list filter="[<currentTab>!match[]]">
<<lingo Filter/Hint>>
</$list>
This filter simply says "if you are not in a tab set, then show the lingo"
-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/0bd875cb-c803-4c43-ac06-4fa031607c05o%40googlegroups.com.