Loading...
 
Skip to main content

History: WikiPluginsDbTutorial

Preview of version: 3

Small tutorial for db interface wiki plugins

This is a very small tutorial for WikiPluginDb. Please contact me if you have problems with that.

These plugins are rather powerful, so you should learn to know them somewhat before you could use all their features.

  1. Create a dsn to tell the plugins how to connect to the db's. The plugins can use multiple databases. If the name of your dsn is default, you won't have to specify it.
  2. I sometimes use the short plugin syntax, which is {PLUGINNAME(param1=>val1,param2=>val2)/}. It should work with the cvs HEAD version, as I made the change some time ago. Don't know from which version it works. You could always use the complete plugin syntax, which should work in every version : {PLUGINNAME(param1=>val1,param2=>val2)}{PLUGINNAME}.
  3. Wiki plugins are processed back-to-front by Tiki. This means that if you want plugin PLUGINA to be executed before PLUGINB, you should write PLUGINB{()/} before PLUGINA{()/}. This could look bad, but it isn't after all: this way, you could put all db requests at the end of the page.
  4. Although plugins are processed (executed) in reverse order by Tiki (the last one first), they display on the right place: where you put them on your page.
  5. Here are some page examples (just paste them in a new wiki page, on a site where the plugins are installed in lib/wiki-plugins/) :

Very basic example: this is a page which displays all data from a table:
{DATATABLE()/}
{REQUEST()}
SELECT * FROM my_table
{REQUEST}
Comments: the request plugin has no db parameter, so it will take the default dsn (=dsn named default). DATATABLE, when used without any parameter, just displays the data from the default request (the first unnamed request).


Another example: display a list of students, with links to individual informations, and allow you to create a new student:
{DATATABLE(title=>1)}
__Id.__|__First name__|__Last name__
*Id|*First_Name|_Last_Name
{DATATABLE}
{REQUEST()}
SELECT Id, First_Name, Last_Name FROM Students
{REQUEST}

History

Information Version
Victor Emanouilov attachment conversion 17
View
16
View
Jarrod Neven 15
View
Jarrod Neven 14
View
Jarrod Neven 13
View
Xavi (as xavidp - admin) np tags removed from inside code tags 12
View
bwente 11
View
Xavi (as xavidp - admin) typo fixed 10
View
Yannick Majoros 9
View
Yannick Majoros 8
View
Yannick Majoros 7
View
Yannick Majoros 6
View
Yannick Majoros 5
View
Yannick Majoros 4
View
Yannick Majoros 3
View
Yannick Majoros 2
View