Hi TwWizards (@Eric & @Morris in particular)
I'm trying to modify Morris Gray's
TwHelpPlugin<http://twhelp.tiddlyspot.com/#TwHelpSearchPlugin>for my needs. It
takes Eric's
SearchOptionsPlugin <http://www.tiddlytools.com/#SearchOptionsPlugin>'s
Searchresults and present them in a table with extra information.
What I want is to show a custom fieldvalue when it is present in a tiddler,
otherwise it should be hidden...
My reason for this is that I use custom fields for students- and teachers
names and numbered IDs for titles. (This way I can have several students or
teachers with the same name). I have custom view- and edittables which use
custom fieldvalues in titledivs and therefore they appear with correct
titles...
What I need to know is how to do sth like this:
"[["+matches[t].customfieldvalue+","fallbacktext or
nothing"|"+matches[t].title+"]] " ???
Excerpt from Morris' code:
// Override default SearchOptionsPlugin formatting for SearchResults
tiddler
window.reportSearchResults=function(text,matches)
{
var title=config.macros.search.reportTitle
config.macros.search.reportTitle;
var q = config.options.chkRegExpSearch ? "/" : "'";
if (!config.options.chkHoldSearches) body="";
body+="\n|>|bgcolor:#4c4c4c;@@color(#ccc):''"+config.macros.search.successMsg.format([matches.length,q+"{{{"+text+"}}}"+q])+"''@@|bgcolor:#4c4c4c;
@@color:#ffffc8; Ver: <<version>>@@ "+"|"+"\n";
body+="|>|>|bgcolor:#999;color:#000;<<search>> <<option
chkSearchTitles>> Titles <<option chkSearchText>> Text <<option
chkSearchTags>>Tags <<option chkHoldSearches>> Hold |"+"\n";
body+="\n|bgcolor:#4c4c4c; |bgcolor:#4c4c4c; ''Titles''
|bgcolor:#4c4c4c; ''Size'' |bgcolor:#4c4c4c; ''Tags'' |bgcolor:#4c4c4c;
''Modified'' |h";
for(var t=0;t<matches.length;t++)
body+="\n"+"| "+(t+1)+"|[["+matches[t].title+"]]|
"+matches[t].text.length+"|"+matches[t].tags+"|"+matches[t].modified.formatString('YYYY.0MM.0DD')+"|";
body+="\n|sortable|k";
body+="\n";
Cheers Måns Mårtensson
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/tiddlywiki?hl=en.