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
--
FlorianSimatos - 08 Sep 2006
Answer
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