Embedding the (standard) Search Bar & Results into a tiddler.

78 views
Skip to first unread message

John Newell

unread,
Oct 11, 2016, 3:25:06 AM10/11/16
to tiddl...@googlegroups.com
Hi.
Could someone please provide the code that will embed the Search Bar ( box ) into a tiddler :
where the results are live links to the resultant tiddlers?

This is for tw-ebooks / apps and as such will be user/reader access only
( That is - "read only" )
hence why the search box
   and the tiddler links
need to be in the tiddler

   ( as there's no sidebar ) visible to readers.

with thanks in advance....

John

BJ

unread,
Oct 11, 2016, 8:59:21 AM10/11/16
to TiddlyWiki
Hi john,
it part of the tiddler $:/core/ui/SideBarLists:

<$set name="searchTiddler" value="$:/temp/search">
<div class="tc-search">
<$edit-text tiddler="$:/temp/search" type="search" tag="input" focus={{$:/config/Search/AutoFocus}} focusPopup=<<qualify "$:/state/popup/search-dropdown">> class="tc-popup-handle"/>
<$reveal state="$:/temp/search" type="nomatch" text="">

<$button popup=<<qualify "$:/state/popup/search-dropdown">> class="tc-btn-invisible">
<$set name="resultCount" value="""<$count filter="[!is[system]search{$(searchTiddler)$}]"/>""">
{{$:/core/images/down-arrow}} {{$:/language/Search/Matches}}
</$set>
</$button>
</$reveal>
<$reveal state="$:/temp/search" type="match" text="">
<$button to="$:/AdvancedSearch" tooltip={{$:/language/Buttons/AdvancedSearch/Hint}} aria-label={{$:/language/Buttons/AdvancedSearch/Caption}} class="tc-btn-invisible">
{{$:/core/images/advanced-search-button}}
</$button>
</$reveal>
</div>

<$reveal tag="div" class="tc-block-dropdown-wrapper" state="$:/temp/search" type="nomatch" text="">

<$reveal tag="div" class="tc-block-dropdown tc-search-drop-down tc-popup-handle" state=<<qualify "$:/state/popup/search-dropdown">> type="nomatch" text="" default="">

{{$:/core/ui/SearchResults}}

</$reveal>
</$reveal>
</$set>


all the best

BJ

John Newell

unread,
Oct 11, 2016, 9:04:43 AM10/11/16
to TiddlyWiki
BJ !!

Awesome

Exactly what I needed in functionality
I'll see if I can "tart it up" a little.
Will send you a copy of the first version I deploy

thanks - much appreciated !!!!   JN
Reply all
Reply to author
Forward
0 new messages