Blog

Read About What We Love: Web Development & Technologies

How to Create a Package in Umbraco

How to Create a Package in Umbraco

In most open source projects in the CMS domain, add-on modules and extensions are available that are used to improve the system functionality. Umbraco package, which is a zip file, can be installed in a few clicks. The zip file contains few or all the below files:

  • A package.xml file
  • A package.manifest file
  • Serverside code such as .dll files
  • Clientside code (.css, .js and .html files, image)

Package.xml

A Package.xml file contains information about the version, license, datatypes used, and details of files used in this package. A sample package.xml file looks like this:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<umbPackage>

  <files>

<file>

      <guid>dashboard.css</guid>

      <orgPath>/App_Plugins/PageComments/css</orgPath>

      <orgName>dashboard.css</orgName>

    </file>

    <file>

      <guid>controller.js</guid>

      <orgPath>/App_Plugins/PageComments/js</orgPath>

      <orgName>controller.js</orgName>

    </file>

</files>

<info>

    <package>

      <name>Page Comments</name>

      <version>1.0</version>

      <license url="http://opensource.org/licenses/MIT">MIT License</license>

      <url>http://www.gajadigital.com</url>

      <requirements>

        <major>3</major>

        <minor>0</minor>

        <patch>0</patch>

      </requirements>

    </package>

    <author>

      <name>Gaja Digital</name>

      <website>http://www.gajadigital.com</website>

    </author>

    <readme><![CDATA[Testing package]]></readme>

  </info>

</umbPackage>

 

Package.Manifest

Package.Manifest file is a JSON file, containing the details about the property editors and files used in the package. A sample .manifest file looks like this:

{             

                propertyEditors: [                           

                                {                                             

                                                alias: "pagecomments",

                                                name: "Page Comments",

                                                editor: {

                                                                view: "~/App_Plugins/pagecomments/views/pagecomments.html",

                                                                valueType: "JSON"         

                                                },

                                }

                ],

                javascript:

    [

        "~/App_Plugins/pagecomments/js/controller.js",

        "~/App_Plugins/pagecomments/js/resource.js"

    ]

In this blog, we explain the steps to create a simple package on Umbraco, to distribute and enable others to use, using Umbraco back office. These are the various steps involved: 

1. Right Click on ‘Create Packages’ link from ‘Developer -> Packages -> Created packages’ as shown in the screenshot below and click on ‘Create’, enter name and click on ‘create’ button.

 

2. Click on the package you created in the Package Properties tab as shown below:

3. In the Package contents folder, select the Document types, templates, Data types, Dictionary items etc. as shown below, which will be automatically created when a plugin is installed.

 

4. In the package files tab, select the list of files or folders to be included as part of the package. These files will be included in the package and when the plugin is installed, these files are copied to appropriate paths.

 

5. Once all the details are entered, save the changes and publish the package by clicking the ‘Publish’ button at the top of the page.

6. The published package exists in ‘\Media\created-packages’ folder of your webinstance.

7. After creating a package, create an account on https://our.umbraco.org and upload the plugin for the community to use.

As seen above, creating a package in Umbraco is very easy and can be done quickly in a hassle-free manner. At Gaja Digital, we help our customers efficiently use Umbraco for all their content management requirements. We hope this article was useful and if you have any queries on Umbraco packages, do get in touch with us.

Manjunath Govindappa | ASP.NET Technical Lead

Shwetha Bhat | Blogger

 

Leave A Comment

Aix-en-Provence – Bangalore – Montreal

We love diversity and we work out of 3 fabulous cities, on 3 continents, and 3 time zones.


Contact us
We’ll get in touch with you ASAP!