Plugin install manifest

From Sohowiki
(Difference between revisions)
Jump to: navigation, search
(Create install manifest)
Line 1: Line 1:
==Create install manifest==
+
==Introduction==
Still in your code editor, create a new blank document (i.e. ctrl + n) and save to your HELLO_WORLD folder as "install_manifest.php".  
+
Each plugin must include in it's folder a file named install_manifest.php. Pro Edition reads this file to know what to do when it attempts to install your plugin. All plugins must have a valid install_manifest.php in their folder.
 
+
install_manifest.php is the file that Pro Edition reads to know what to do when it attempts to install your plugin. All plugins must have a valid install_manifest.php in their folder.
+
  
 
There are two types of content in any given install_manifest.php:
 
There are two types of content in any given install_manifest.php:

Revision as of 14:36, 27 July 2006

Contents

Introduction

Each plugin must include in it's folder a file named install_manifest.php. Pro Edition reads this file to know what to do when it attempts to install your plugin. All plugins must have a valid install_manifest.php in their folder.

There are two types of content in any given install_manifest.php:

  1. Information - plugin title, author, etc
  2. Instructions - "hook me in here, here, and here"

Include basic descriptive info about your plugin

Let's start with the information part. Copy-paste the following lines into your new (and completely empty at this point) install_manifest.php file...

# PLUGIN INFO
$plugin_folder = "HELLO_WORLD";
$plugin_title = "Hello World";
$plugin_version = "1.0";
$plugin_author = "John Smith";
$plugin_homepage = "http://example.com";

# Description text
$plugin_description = "Adds '- Hello World!' next to the 'Basic Features Group' on the main menu.";

Additional (optional) stuff you can also include

Custom icon image for your plugin

If you'd like your plugin to have it's own icon displayed next to it's name in the Plugin Manager (instead of the default puzzle piece graphic), include the image file in your plugin folder, and add a line like this to your install_manifest.php...

$plugin_icon = "my_plugin_icon.gif"

Tell Pro Edition how to plug-in your plugin

This is the part where you tell Pro Edition how and where to plug-in your plugin (heh). So our specific task at the moment is to tell Pro Edition (through our install manifest) to add our "- Hello World" change to the main menu.

Add this line to your install_manifest.php file...

hook_overwrite("sohoadmin/program/main_menu.php", "main_menu-helloworld.php");

The hook_overwrite function tells Pro Edition to use your version of main_menu.php (main_menu-helloworld.php) instead of the regular one.

Completed install manifest

Here's what your completed install_manifest.php file should look like...

<?
# PLUGIN INFO
$plugin_folder = "HELLO_WORLD";
$plugin_title = "Hello World";
$plugin_version = "1.0";
$plugin_author = "John Smith";
$plugin_homepage = "http://example.com";

# Description text
$plugin_description = "Adds '- Hello World!' next to the 'Basic Features Group' on the main menu.";

# Replace main_menu.php with my custom-modified version
hook_overwrite("sohoadmin/program/main_menu.php", "main_menu-helloworld.php");
?>
Personal tools