Question
Hi there! We are in the process of evaluating TWiki for use as our company intranet.
We have a
MySQL database which contains a table of Software Requests.
In a static topic I have been able to create a DBI query using the
DBIQueryPlugin which lists a subset of the records in the table.
What we would like to do is have a link in each record in the list which takes you to a page which gives full details of the record that was selected.
We don't want to create a topic for each record, so I was wondering if there is a way to use a template to achieve this.
For example, lets say that a particular record in the list in topic "OpenIDs" has an ID of 12712. I was thinking that I could call a template using the format: view/Main/OpenIDs?template=RequestDetails¶m1=12712.
Is this possible?
Sorry if this has been asked before or is answered elsewhere. I have spent a couple of days looking through this huge site and trawling through the templates themselves, but could not find anything that helps.
Thanks in advance for any help.
Environment
--
DuncanKinnear - 07 Dec 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.
Yes, for sure. You can put almost anything in a template that you can put in a topic, and a %DBIQUERY call is no exception. To demonstrate this, just take a copy of
view.pattern.tmpl, and call it
view.reqdet.tmpl. Add your DBIQUERY with the %URLPARAM{reqdet} into one of the DEFs e.g. the
beforetextcontents def. Then add the
?cover=reqdet parameter to the URL
view/Main/OpenIDs?cover=reqdet&id=12712. You will probably need to experiment a bit with what goes where in the template.
--
CrawfordCurrie - 14 Dec 2006