Tags:
create new tag
, view all tags

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&param1=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

TWiki version: TWikiRelease04x00x05
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Ubuntu
Web server: Apache/2.0.55
Perl version: 5.8.7
Client OS:  
Web Browser:  
Categories:  

-- DuncanKinnear - 07 Dec 2006

Answer

ALERT! If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list 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

 
Change status to:
Topic revision: r2 - 2006-12-14 - CrawfordCurrie
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.