This question about Topic Markup Language and applications: Answered

SEARCH Format Change Post 1.1.2 Upgrade

After upgrading from 1.0.9 to 1.1.2, my SEARCH macros no longer return formatted results in column format. Can anyone tell me what I need to do to fix this functionality? I can provide screenshots of before/after if that helps...

%SEARCH{"ProcedureCategory" nosearch="on" nosummary="on" excludetopic="AllTopicsCategory, ProcedureCategory, WebStatistics, Support.WebHome"}%

-- BradEgan - 12 Jan 20111

Your search misses any format parameter setting and you exclude the topic you're searching for, so: yes, screenshots could help. wink

-- FranzJosefGigler - 12 Jan 2011

I followed the tips found on this website to organize my topics into Categories by tagging them with a keyword. In this case, it is ProcedureCategory. On the ProcedureCategory page, that search macro is presence and returns a list of all topics tagged with that keyword (ProcedureCategory).

Below are two screenshots. One showing the formatted search results on 1.0.9 and the other showing the unformatted search results on 1.1.2

Search Results on 1.0.9

Search Results on 1.1.2

-- BradEgan - 14 Jan 2011

As FranzJosefGigler said, you'd have to add a format parameter (looks like the default format changed between 1.0.9 and 1.1.2):
format="| [[%WEB%.$topic][$topic]] | $date | $percntCALC{$IF($rev > 1, r$rev, $percntN$percnt)}$percnt | $wikiusername |"
-- MartinKaufmann - 14 Jan 2011

Another solution if you want to avoid CALC is the following (untested, btw don't think you need the excludetopic if you're using a QuerySearch):

%SEARCH{
  "ProcedureCategory"
  type="query"
  nosearch="on"
  nosummary="on"
  excludetopic="AllTopicsCategory, ProcedureCategory, WebStatistics, Support.WebHome"
  format="| [[$web.$topic][$topic]] | $date | $percentIF{
    \"'$web.$topic'/info.version='1'\"
    then=\"$percentN$percent\"
    else=\"r$rev\"
  }$percent | [[$wikiusername][$wikiname]] |"
}%

Check out the search with conditional output in System.FormattedSearch on Foswiki 1.1

-- PaulHarvey - 15 Jan 2011

Paul,

Thanks for the suggestion but that did not work. I thought it was the "percent" instead of "percnt" but it still said *"Number of Topics: 0" after I changed the variable. Also, why would I want to avoid using CALC? Is it more resource intensive and/or slower?

Martin,

Thanks for the code example. That worked but I had to add the header parameter. Question though, how do I "format" the "format"? What I mean to say is can I left/right/center justify the text? How do I add leading and/or trailing spaces? Right now the requests in each column run right up next to each other in instances where the value in the column is the longest string.

Thanks for all of the help!

-- BradEgan - 17 Jan 2011

The format contains a standard Foswiki table so you can format the columns as described in EditingShorthand (under the heading Tables). You can also add a %TABLE% macro to use all the formating described in TablePlugin (e.g. columnwidths to hard-code the width of all the columns).

-- MartinKaufmann - 17 Jan 2011

Thanks for helping a noob! I've got it now smile

-- BradEgan - 17 Jan 2011

QuestionForm edit

Subject Topic Markup Language and applications
Extension
Version Foswiki 1.1.2
Status Answered
Topic revision: r10 - 10 Jan 2013, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy