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 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

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