Now, updated for Tiki 8!
Now accepting new user registrations! Become a contributor.
| More
Join Print Print multiple pages Convert to PDF

Writing Plugins


Plugins are the way to extend Tiki's wiki functionality to do anything (and everything) that you want. Although Tiki includes over 100 plugins, you may find it necessary to create your own plugin that meets your specific needs. This section will show you how.
NoteNote:
This section is not a guide to PHP programming. For details on PHP, see http://www.php.net(external link).


TipTip:
If you are new to Tiki, start with Using Plugins(external link) in Tiki for Dummies Smarties(external link). For complete information on Tiki plugins, refer to the Tiki Documentation Tiki(external link).



When to Use a Plugin

Basically, you should use a plugin to accomplish anything that you cannot normally do with regular Tiki wiki syntax. This could be something as simple as changing the font or color of text, or a complex as performing datbase queries and returning SQL values.

You could, of course, use existing plugins (such as the HTML or JS plugins) and then include the specific code or script. While this method will definitely work (and may even be easier initially) it is not very "futureproof." If you ever want to change or update the script, you will have to manually make the change every place that you added it. Whereas with a plugin, you simply update the plugin once. Tiki will automatically update the code on every page that uses the plugin.

In other cases, a plugin is simply needed if you want to vary the output, depending on the contents of the database.
NoteNote:
See Adding Widgets and Scripts for additional examples of plugins.



Writing a Simple Plugin

This is an example of a pull quote.
Let's write a simple plugin that will allow you to create a pull quote1 on a wiki page, as shown on the right side of this page.

We'll want users to be able to define:
  • Where the pull quote appears (on the left or right side of the page)
  • The width (in pixels)
  • The color of the text

Create a new, empty PHP file named wikiplugin_pullquote.php.
NoteNote:
Wiki plugins should be named using the convention wikiplugin_NAME_OF_THE_PLUGIN.php.

There are three basic steps to creating a plugin:



1. A pull quote (also known as a lift-out quote or a call-out) is a quotation or edited excerpt typically placed in a larger typeface on the same page. http://en.wikipedia.org/wiki/Pull_quote(external link)



Contributors to this page: Rick Sapir and system .
Page last modified on Thursday, October 21, 2010 10:15:36am EDT by Rick Sapir.
The content on this page is licensed under the terms of the Copyright Information.

Buy the Books

Tiki Essentials & Tiki for Smarties -- Buy the Books.
Available from Amazon, LuLu, and more as paperback or ebook...

What do you think?

What do you think of this project?



Anti-Bot verification code image Try another code



View Results
(Votes: 20)

"It is a great achievement for the community!"

Is Essentials helpful?

Essential Readers



Advertising



Powered by Tiki Wiki CMS Groupware
Creative Commons Copyright. Some rights reserved.
Tiki Essentials (this site) is © 2011-2012 by Rick Sapir, published by KeyContent.org, and is licensed
under a Creative Commons Attribution-Share Alike 3.0 United States License. Some rights reserved. Privacy Policy.
Permissions beyond the scope of this license may be available at http://twessentials.keycontent.org/Copyright Information.
Questions, comments, or concerns about this site or the guide? Let me know.
New to Tiki? Try Tiki for Dummies Smarties: A beginner's guide to using Tiki Wiki CMS Groupware.


Feedback Form
Feedback Analytics