Difference between revisions of "Suggested and Required Directory Layout and Files"
(a few links and minor corrections) |
|||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | The file layout for Geeklog Blocks has no specific requirements. Most blocks have no separate files that are included in | + | == Blocks == |
+ | |||
+ | The file layout for Geeklog [[Blocks]] has no specific requirements. Most blocks have no separate files that are included in Geeklog's 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 <tt>plugins/{plugin}</tt> directory, then put them in a directory called <tt>blocks/{block}</tt> at the same level as the <tt>plugins</tt> directory. | ||
+ | |||
+ | == Plugins == | ||
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. | 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. | ||
− | #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/ | + | # 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: <tt>{path_to_geeklog}/plugins/greatplugin/</tt> |
− | #All files required for the administration of the plugin should be placed in a | + | # All files required for the administration of the plugin should be placed in a directory named for the plugin under the <tt>plugins</tt> directory of the <tt>admin</tt> directory. Thus it would be: <tt>{path_to_admin_directory}/plugins/greatplugin/</tt> |
− | #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/ | + | # All files required for the user interface to your plugin should be in a directory named after your plugin under the <tt>public_html</tt> directory. Thus it would be: <tt>{public_html}/greatplugin/</tt> |
Files required for a plugin to correctly function: | Files required for a plugin to correctly function: | ||
− | *Under number 1 above: | + | * Under number 1 above: |
− | **function.inc | + | ** function.inc |
− | *Under number 2 above: | + | * Under number 2 above: |
− | **install.php | + | ** install.php |
− | **index.php | + | ** index.php |
− | *Under number 3 above: | + | * Under number 3 above: |
− | **index.php | + | ** index.php |
− | **images/{plugin}.gif | + | ** images/{plugin}.gif |
+ | |||
+ | Note: the image is required by the command and control block. Plugins can provide the complete URL of the image with the <code>PLG_getIcon</code> API function. | ||
− | + | 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 of 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. | ||
− | + | [[Category:Plugin Developers Handbook]] [[Category:Plugin Development]] | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 17:42, 16 May 2009
Blocks
The file layout for Geeklog Blocks has no specific requirements. Most blocks have no separate files that are included in Geeklog's 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.
Plugins
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.
- 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/
- All files required for the administration of the plugin should be placed in a directory named for the plugin under the plugins directory of the admin directory. Thus it would be: {path_to_admin_directory}/plugins/greatplugin/
- 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 image is required by the command and control block. Plugins can provide the complete URL of the image with the PLG_getIcon
API function.
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 of 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.