Creating a basic plugin

From Sohowiki
(Difference between revisions)
Jump to: navigation, search
(Modify source file)
Line 19: Line 19:
 
Stick this file in the "HELLO_WORLD" folder you created on your PC, and rename it to something like "main_menu-helloworld.php" (actual filename doesn't really matter, as long as you recognize it as your modified version of main_menu.php).
 
Stick this file in the "HELLO_WORLD" folder you created on your PC, and rename it to something like "main_menu-helloworld.php" (actual filename doesn't really matter, as long as you recognize it as your modified version of main_menu.php).
  
==Modify source file to hearts content==
+
==Modify source file==
 
No pull up the file in your trusty code editor.
 
No pull up the file in your trusty code editor.
  
Line 32: Line 32:
 
</pre>
 
</pre>
  
Now save the file.
+
Save the file.
  
==Step 2: Create an install manifest==
+
==Create an install manifest==
 +
In your HELLO_WORLD folder create a new file called "install_manifest.php". 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 to types of content in any given install_manifest.php:
 +
#Information - plugin title, author, etc
 +
#Instructions - "hook me in here, here, and here"
 +
 
 +
Let's start with the instructions...

Revision as of 15:37, 17 May 2006

Contents

Introduction

This tutorial will walk you through the creation of a basic plugin that adds the text "Hello World" to Pro Edition's Main Menu, next to the "Basic Features Group" header.

Reccommended stuff you'll want for this tutorial

I'll be writing this under the assumption that you've already got the following covered...

  • A website with Soholaunch Pro Edition installed on it that you can screw around with. All feature modules should be enabled.
  • FTP client and FTP access to your test site
  • Some kind of code/text editor to edit php files with (Dreamweaver, UltraEdit, PHP Edit, Emacs, Notepad, etc.)
  • Decent profeciency working with html, css, and php
  • Some level of familiarity with Pro Edition's various folders and files (i.e. sohoadmin)

Create a folder for your plugin

Pop open Windows Explorer (or Mac/Linux equivalent) and create a folder on your local PC called "HELLO_WORLD". All of your plugin's files will go in this folder.

Download the source file you want to modify

Open Your FTP client and log-in to your test site. For this example, we want to modify Pro Edition's main menu, so download this file from your test site...

public_html/sohoadmin/program/main_menu.php

Stick this file in the "HELLO_WORLD" folder you created on your PC, and rename it to something like "main_menu-helloworld.php" (actual filename doesn't really matter, as long as you recognize it as your modified version of main_menu.php).

Modify source file

No pull up the file in your trusty code editor.

Do a ctrl+f (find) on "Basic Features Group", and you should get to a line that looks something like...

<td class="fgroup_title"><? echo lang("Basic Features Group"); ?></td>

Modify this line so it looks like this:

<td class="fgroup_title"><? echo lang("Basic Features Group"); ?> - Hello World</td>

Save the file.

Create an install manifest

In your HELLO_WORLD folder create a new file called "install_manifest.php". 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 to types of content in any given install_manifest.php:

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

Let's start with the instructions...

Personal tools