Building a Blog Plugin ###################### Build a simple blogging plugin using Elgg. This duplicates features in the bundled blog plugin, so be sure to disable that while working on your own version. .. contents:: Contents :local: :depth: 1 Create the plugin skeleton ========================== The name of the directory under "mod" becomes the id of your plugin:: /mod/my_blog/pages/my_blog/ /mod/my_blog/actions/my_blog/ /mod/my_blog/views/default/my_blog/ You'll need to add a manifest file in ``/mod/my_blog/manifest.xml``. This file stores basic information about the plugin. See :doc:`/guides/plugins` for the template. You can also just copy the manifest file from another plugin and then change the values to fit your new plugin. Be sure to change the author and website, and remove the “bundled” category! Create a page for composing the blogs ===================================== Create the file ``add.php`` in ``/mod/my_blog/pages/my_blog/``. .. code:: php $content, 'sidebar' => $sidebar )); // draw the page echo elgg_view_page($title, $body); Create the form for creating a new my\_blog post ================================================ Create a file at ``/mod/my_blog/views/default/forms/my_blog/save.php`` that contains the form body. This corresponds to view that is called above: ``elgg_view_form("my_blog/save")``. The form should have input fields for the title, body and tags. Because you used ``elgg_view_form()``, you do not need to include form tag markup. The view will be automatically wrapped with: * a ``