Difference between revisions of "Suggested and Required Directory Layout and Files"

From GeeklogWiki
Jump to: navigation, search
m (Changed category)
Line 45: Line 45:
 
**etc
 
**etc
  
[[Category:Plugin_Developers_Handbook]]
+
[[Category:Plugin Development]]

Revision as of 20:14, 10 May 2008

The file layout for Geeklog Blocks has no specific requirements. Most blocks have no separate files that are included in Geeklogs directory structure. For those that do have external files, we would suggest that you follow the directory structure outlined below for plugins. If you have files that are located outside the webtree, like those located in the plugins/{plugin} directory, then put them in a directory called blocks/{block} at the same level as the plugins directory.

For Plugins it is a different story. There are several required files and directories and specific places your should put your other files. In the examples below we will assume that you are creating a plugin named 'greatplugin'. Each plugin must have three separate directories.

  1. All files that are not required to be in the webtree (usually include files, templates, config files, documentation, etc) should be placed in a directory named for the plugin under the plugins directory. Thus it would be: {path_to_geeklog}/plugins/greatplugin/
  2. All files required for the administration of the plugin should be placed in a file named for the plugin under the plugin directory of the admin directory. Thus it would be: {path_to_admin_directory}/plugins/greatplugin/
  3. All files required for the user interface to your plugin should be in a directory named after your plugin under the public_html directory. Thus it would be: {public_html}/greatplugin/

Files required for a plugin to correctly function:

  • Under number 1 above:
    • function.inc
  • Under number 2 above:
    • install.php
    • index.php
  • Under number 3 above:
    • index.php
    • images/{plugin}.gif

Note: the gif image is required by the command and control block and must be named after the plugin the same as the directory names.

You can find skeletal versions of all these files and more in the Universal Plugin Toolkit.

The complete directory structure is listed below: once again you must replace {plugin} with the name or your plugin.

  • admin/plugins/{plugin}
    • install.php
    • index.php
  • public_html/{plugin}
    • index.php
  • public_html/{plugin}/images
    • {plugin}.gif
  • plugins/{plugin}
    • functions.inc
    • config.php
    • README
    • INSTALL
  • plugins/{plugin}/language
    • english.php
    • german.php
    • etc
  • plugins/{plugin}/templates/
    • install.thtml
    • admin.thtml
    • index.thtml
    • etc