Definition

Navigation:  Development > Addons >

Definition

Previous pageReturn to chapter overviewNext page

Definition is a XML file that point resource links and keep setting information. Generally all XML files are saved in below location:

 

/development/definition/addons

 

Each XML file can load one of multiple addons, it depends on the number of <addon> tag available in the file. Each addon tag has a name that used to load it from Action Method.

 

Here is common attributes of a Addon tag:
 

Name used to uniquely identify an and load.

Title is addons lable that we see in admin addons page.

Description is common explanation of the addon.

Javascripts tag load all Script.

Style_sheets load all Css files

code used write some inline JavaScript

author_name contain addon creator name

author_uri creator personal website

addon_uri official website of addon

layouts contain list of Layout names allow for load. By default we set all. (Useful for Always Load Addons)

layouts_except is the list of Layouts which are forbidden for this addon. (Useful for Always Load Addons)

status used to enable/disable an addon

load used to set loading method of an addon. We can  select OnRequest or Always. Of onrequest we have to load resource by force form Action Method..

 

See below     example :

 

<Addons>
    <addon name="linedtextarea">
        <title><![CDATA[Lined Textarea]]></title>
        <description><![CDATA[Add Line Number in Textarea]]></description>
        <javascripts>
            <src>/addons/linedtextarea/linedtextarea.js</src>
        </javascripts>
        <style_sheets>
            <link>/addons/linedtextarea/linedtextarea.css</link>
        </style_sheets>
        <code>
            <![CDATA[
            <script type="text/javascript">
            jQuery(function() {
                jQuery(".lined").linedtextarea(
                    {selectedLine: 1}
                );
            });
            </script>
        ]]>
        </code>
        <author_name>Reazaul Karim</author_name>
        <author_uri>http://reazulk.wordpress.com</author_uri>
        <addon_uri>http://www.apprain.com</addon_uri>      
        <layouts>All</layouts>
        <layouts_except></layouts_except>
        <status>Active</status>
        <load>OnRequest</load>
    </addon>
</Addons>