Tags:
create new tag
view all tags

Question

Hi,

I have two questions related to the bibtex plugin, and more precisely to the search form.

1- how can I create radio buttons that would propose to select the type of the references? typically, to display only ARTICLES, or UNPUBLISHED, etc...

2- the question is linked: how can I create a search form that would only look for entries with a certain type? Typically, I would like to write something like

  %BIBTEX{form="on" topic="MyTopic" select="$type='ARTICLE'"}%
that would only display entries @ARTICLE.

I asked a similar question for the style (once the query was made, it was using a default style), but the same fix did not work.

Thanks in advance!

Environment

TWiki version: TWikiRelease04x00x04
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin, BibtexPlugin, BreadCrumbsPlugin, CommentPlugin, EditTablePlugin, EmptyPlugin, FilterPlugin, FlexWebListPlugin, GluePlugin, IfDefinedPlugin, InterwikiPlugin, NatSkinPlugin, PreferencesPlugin, RedDotPlugin, RenderListPlugin, SlideShowPlugin, SmiliesPlugin, SpreadSheetPlugin, TablePlugin, TwistyPlugin
Server OS: Mandriva Linux 2006, kernel 2.6.12
Web server: Apache 2.0.54
Perl version: 5.8.7
Client OS: Mandriva Linux 2006, kernel 2.6.12
Web Browser:  
Categories: Plugins

-- FlorianSimatos - 08 Sep 2006

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.

(Allow me to answer in reverse order)

The select functionality is handled by bib2bib, so that is the documentation to consult for the second question. In your case, %BIBTEX{ form="on" topic="MyTopic" select=" $type : 'INPROCEEDINGS'  "}% or %BIBTEX{ form="on" topic="MyTopic" select=" $type : 'ARTICLE'  "}% will select either InProceedings or Article entries from the attached .bib files.

You can also add conditions to the select, such as %BIBTEX{ sort="year" select=" ($type : 'ARTICLE' or $type : 'INPROCEEDINGS') and author : 'Simatos' "}% which would show all manuscripts and conference articles by Simatos, and ignore entries such a misc and unpublished.

It appears that the difference between my expressions (which worked on my install) and yours are switching the equals sign, =, with a semi-colon, :. I believe that bib2bib uses the equals sign only for numerical comparisons. All others use the semi-colon.

Now, the search form crafts a similar expression using bibsearch. To answer your first question, you only need to replace

<td><input type="text" name="type" size="50"  value="" /></td>
with
<td>
<select name="type" width="50">
<option value="">any type</option>
<option value="ARTICLE">Article</option>
<option value="INPROCEEDINGS">InProceedings</option>
<option value="BOOK">Book</option>
</select>
</td>

Of course, you can add more options to cover different bibtex entry types.

I hope this helps.

-- ScottHoge - 08 Sep 2006

Thanks, it does help! Though I realize my second question was not very clear...

Actually, what I wanted to do is to be able to use the same search template, but to force certain conditions. So using

%BIBTEX{form="on" topic="MyTopic" select="$type='ARTICLE'"}%
would create a search form that would only look for articles. But the drop-down list is actually easier, so I'm all set!

Thanks

-- FlorianSimatos - 11 Sep 2006

Change status to:
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2006-09-11 - FlorianSimatos
 
  • 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.