step‐by‐step guide to creating and distributing a package in Umbraco 8 - FadiZahhar/umbraco8showandtell GitHub Wiki
Ensure you have:
- An Umbraco 8 project set up and running.
- Access to the project's file system and the Umbraco backoffice.
- Basic knowledge of Umbraco's structure and components.
-
Log in to the Umbraco backoffice.
-
Navigate to the Packages section.
-
Click on Created in the top-right corner.
-
Click the Create package button.
-
Fill in the package details:
-
Name: e.g.,
Custom Welcome Dashboard
. - Version, Author, License, etc.
-
Name: e.g.,
-
Under Package Contents, select the items you want to include:
- Document Types, Data Types, Templates, Stylesheets, Scripts, Partial Views, etc.
-
Click Create to generate the package schema.
-
Click Download to download the package as a
.zip
file.([docs.umbraco.com][1], [docs.umbraco.com][2])
The downloaded .zip
file contains:
-
package.xml
: Contains metadata and definitions of the included items. - Folders for any included media or other assets.([docs.umbraco.com][2], [Umbraco][3], [docs.umbraco.com][1])
You can inspect and modify the package.xml
if needed to fine-tune the package contents.
For broader distribution, especially if you plan to share your package via NuGet, follow these steps:([Umbraco][3])
-
Set Up a Class Library Project:
- In Visual Studio, create a new Class Library (.NET Framework) project.
- Add your custom code, views, and other assets to this project.([codeshare.co.uk][4], [Stack Overflow][5])
-
Organize the
App_Plugins
Folder:- Create an
App_Plugins
folder in your project. - Place your package's files (e.g.,
package.manifest
, views, scripts) insideApp_Plugins/YourPackageName/
.
- Create an
-
Edit the
.csproj
File:-
Include the following properties within the
<PropertyGroup>
:([docs.umbraco.com][1])<PackageId>YourPackageName</PackageId> <Version>1.0.0</Version> <Authors>Your Name</Authors> <Company>Your Company</Company> <Description>Your package description.</Description> <PackageLicenseExpression>MIT</PackageLicenseExpression> <PackageProjectUrl>https://yourprojecturl.com</PackageProjectUrl> <RepositoryUrl>https://github.com/yourrepo</RepositoryUrl> <RepositoryType>git</RepositoryType>
-
Ensure that the
App_Plugins
folder is included in the package by adding:([docs.umbraco.com][2])<ItemGroup> <Content Include="App_Plugins\**\*.*" Pack="true" PackagePath="contentFiles\any\any\App_Plugins\" /> </ItemGroup>
-
-
Build the NuGet Package:
-
Open the command prompt and navigate to your project directory.
-
Run:([Umbraco][6])
nuget pack YourProject.csproj
-
This will generate a
.nupkg
file in the output directory.
-
-
Via Umbraco Package Repository:
- Log in to [Our Umbraco](https://our.umbraco.com/).
- Navigate to the Packages section.
- Click Create Package and upload your
.zip
file.
-
Via NuGet:
- Create an account on [NuGet.org](https://www.nuget.org/).
- Upload your
.nupkg
file. - Once published, others can install your package using NuGet Package Manager.
Before distributing, test your package to ensure it installs and functions correctly:
-
Install the Package:
- In a fresh Umbraco 8 project, install your package via the backoffice or NuGet.([docs.umbraco.com][2])
-
Verify Functionality:
- Check that all included components (e.g., document types, templates, dashboards) are present and working as expected.
-
Check for Errors:
- Monitor the logs for any installation errors or issues.