Building a Custom Plugin
Custom plugins can extend Novulgo to do almost anything you can imagine. Plugins must be written in Perl, and must follow a standard syntax.
Plugin Template
Below is a standard template for creating a basic custom plugin.
#!/usr/bin/perl -w
#####################################################################
# #
# PLUGIN : My Custom Plugin #
# UPDATED : January 13, 2010 #
# #
#####################################################################
package NovLib;
#####################################################################
sub my_custom_plugin {
my $text = "Hello, my name is Les!";
return($text);
}
#####################################################################
1;
Copy and paste the above code into a plain text file. Use a plain-text editor such as notepad.
Save the plugin as my_custom_plugin.pm
In order to function properly, the plugin file name must be the same as the name of the subroutine, adding the .pm suffix.
Upload the plugin file to the data/plugins folder on your server.
Call the plugin in a page template using the following syntax:
PLUGIN:my_custom_plugin()
That's all there is to creating a custom plugin. Obviously, this is a very basic example, but provides you with the proper synatx for creating custom plugins to fit your needs.
posted Jan 13, 2010 5:01 PM in Plugins: Custom
