Tags:
create new tag
view all tags

Question

I'd like to list all the topics in a weby by classification.

I have a Classification topic which has a table in wich the first field is the classification name.

  1. Can I use SearchTopicNameAndTopicText to pull out the list of topics?
  2. Can I use a nested search and RenderListPlugin to format that.

I realise that tis nested search and formatting gets quite involved. To date, nested searches have defeated my. Could someone help with this please.

Environment

TWiki version: TWikiRelease02Sep2004
TWiki plugins: DefaultPlugin, CommentPlugin, SessionPlugin EmptyPlugin, InterwikiPlugin
Server OS: Red Hat
Web server: Apache 2
Perl version: 5.8.3
Client OS: Linux
Web Browser: Firefox
Categories: Forms, Search, Documentation, Plugins

-- AntonAylward - 17 Jul 2005

Answer

ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.

Could you bring an example?

-- PeterThoeny - 17 Jul 2005

Yes.

I have a topic classifcation table similar to the one at TopicClassification in that it has a table whose first field is the classification name.

Most, but obviously not all, topics in that web have a WebForm in which one field is a MetaData entry containing the TopicClassification and corresponds to one of the entries in the table.

Its no different to the situation here at twiki.org.

-- AntonAylward - 17 Jul 2005

Anton - If you are using TopicClassificationAddOn, the following nested search will produce the list of topics grouped by TopicType:

%SEARCH{"[T]opicType.*value\=.*[T]opicType" regex="on" casesensitive="on" nosearch="on" nototal="on" format="---++ $web.$topic $n()$percntSEARCH{ \"[T]opicType.*value\=.*$topic\" regex=\"on\" format=\"   * $dollarweb.$dollartopic - $dollarsummary\" nosearch=\"on\" nototal=\"on\" }$nop%" }%

Note that this search does not extract the Classification list from the table but rather from topics classified as TopicType (comparable to CategoryCategory).

Slight modifications would produce a similar list grouped by other Classification schemes (such as SubjectArea). I used a similar search pattern to create a directory of websites referenced in my weblog application in TopicClassificationAddOn (see topic called WebLogLinkList).

-- LynnwoodBrown - 17 Jul 2005

Thanks Lynnwood.

The reason I don't use that approach is trhat it only lists the categries for which there are topics.

I need to have a report where some of the categories (classficiations) dont have any members.

-- AntonAylward - 18 Jul 2005

Just to be clear, the above search does not require that every classification have a topic with that classification - but only that there is a topic that defines each classification (again, similar to CategoryCategory topics).

In any case, if you want to extract the classification list from a form, I think the following search pattern should do the trick (but untested). I fashioned this search after the "pattern 1" in SearchPatternCookbook.

%SEARCH{ "^\|[^\|]*\| *option *\|" topic="YourTopicWithTable" regex="on" multiple="on" nosearch="on" nototal="on" format="---++ $web.$pattern(^\| *(.*?) *\|.*)</option>$n()$percntSEARCH{ \"[T]opicType.*value\=.*$pattern(^\| *(.*?) *\|.*)\" regex=\"on\" format=\"   * $dollarweb.$dollartopic - $dollarsummary\" nosearch=\"on\" nototal=\"on\" }$nop%" }%

-- LynnwoodBrown - 18 Jul 2005

Anton, I think I have something similar to what you're looking for:

<form name="selectType" action="%SCRIPTURLPATH%/view%SCRIPTSUFFIX%/%WEB%/" >
<select name="type" size="1" onchange="document.location=this.value;"> 
%SEARCH{ "^\|[^\|]*\| *option *\|" topic="KennisSpecialismen" web="GeoWiki" regex="on" 
multiple="on" nosearch="on" nototal="on" format="<option value=%INCLUDINGTOPIC%?
type=\"$pattern(^\| *(.*?) *\|.*)\">$pattern(^\| *(.*?) *\|.*)</option>" }% 
<option value=%INCLUDINGTOPIC%>All pages</option> </select>
</form>

%BR%
*Show: %URLPARAM{"type" default="All pages"}%*
%BR%
%SEARCH{"*;%URLPARAM{type}%" web="GeoWiki" regex="on" casesensitive="on" nosearch="on" 
format="   * $topic - $date - $wikiusername %BR% <font face=\"arial,helvetica\" size=\"1
\"> $formfield(KennisSpecialismen)</font>" sort="topic"}%

The select form pulls all first fields from the table in the KennisSpecialismen topic (which are the classifications for the KennisSpecialismen TWikiForm field). Changing the form shows only the topic with that classification.

-- JosMaccabiani - 02 Sep 2005

Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2005-09-02 - JosMaccabiani
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.