I created a custom search bar results for the main search bar.  Everything 
works except each search result shows a ' </span>' at their end. This only 
happens in the second list, which I replaced the second filter field 
transclusion with a macro.  So that may be the issue-- the macro breaking 
the span.

Attached is a json file with the 2 tiddlers needed to test it at TW . com
Also let me know if i incorporated the regexp (second list for searching 
beginnings of words, the first search beginning of title only) properly.  
I'm still figuring out why the count isn't registering properly

As always, thank you in advance.

$:/.wt/ModSearchResultListTitle
```
\define var-wordbegins() 
[!is[system]search:title,caption:regexp[\b$(srchbrval)$]sort[title]limit[250]]
\define searchResultList()
<$set name="srchbrval" value=<<userInput>>>
//<small>Beginning of title</small>//

<$list filter="[<userInput>minlength[1]]" variable="ignore">
<$list filter={{{ [<configTiddler>get[first-search-filter]] }}}>
<span class={{{[<currentTiddler>addsuffix[-primaryList]] 
-[<searchListState>get[text]] +[then[]else[tc-list-item-selected]] }}}>
<$transclude tiddler="$:/.wt/ui/ListItemTemplateTitleCaption"/>
</span>
</$list>
</$list>
<hr style="margin:5px auto 0px;"/>//<small>Any word in title</small>//<hr 
style="margin:0px auto;"/>
<$list filter="[<userInput>minlength[1]]" variable="ignore">
<$list filter=<<var-wordbegins>>
<span class={{{[<currentTiddler>addsuffix[-secondaryList]] 
-[<searchListState>get[text]] +[then[]else[tc-list-item-selected]] }}}>
<$transclude tiddler="$:/.wt/ui/ListItemTemplateTitleCaption"/>
</span>
</$list>
</$list>
</$set>
\end
<small>Searches titles & (alternate titles) only</small><br/>
<<searchResultList>>
```

$:/.wt/ModSearchResultListTitle

\define var-wordbegins() 
[!is[system]search:title,caption:regexp[\b$(srchbrval)$]sort[title]limit[250]]
\define searchResultList()
<$set name="srchbrval" value=<<userInput>>>
//<small>Beginning of title</small>//

<$list filter="[<userInput>minlength[1]]" variable="ignore">
<$list filter={{{ [<configTiddler>get[first-search-filter]] }}}>
<span class={{{[<currentTiddler>addsuffix[-primaryList]] 
-[<searchListState>get[text]] +[then[]else[tc-list-item-selected]] }}}>
<$transclude tiddler="$:/.wt/ui/ListItemTemplateTitleCaption"/>
</span>
</$list>
</$list>
<hr style="margin:5px auto 0px;"/>//<small>Any word in title</small>//<hr 
style="margin:0px auto;"/>
<$list filter="[<userInput>minlength[1]]" variable="ignore">
<$list filter=<<var-wordbegins>>
<span class={{{[<currentTiddler>addsuffix[-secondaryList]] 
-[<searchListState>get[text]] +[then[]else[tc-list-item-selected]] }}}>
<$transclude tiddler="$:/.wt/ui/ListItemTemplateTitleCaption"/>
</span>
</$list>
</$list>
</$set>
\end
<small>Searches titles & (alternate titles) only</small><br/>
<<searchResultList>>
```
first-search-filter:
[!is[system]search:title,caption:literal,anchored<userInput>sort[title]limit[250]]

second-search-filter:
[!is[system]search:title,caption:regexp<var-wordbegins>sort[title]limit[250]]

$:/.wt/ui/ListItemTemplateTitleCaption
```
<div class="tc-menu-list-item">
<$link><$view field="title"/></$link> <$list 
filter="[<currentTiddler>has[caption]]">(<$view field="caption"/>)</$list>
</div>
```

-- 
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/4e41a2da-0b2d-4816-a6d6-2e9e1fb83c22n%40googlegroups.com.

Attachment: modifiedsearchbarresults.json
Description: application/json

Reply via email to