This article is no longer valid if you are running Umbraco 9 or higher.
Package actions are a way to perform common tasks while installing / uninstalling packages. Currently we have 2 actions available. If you need to perform more advanced installation routines, you will have to write your own package action, which will then automatically be picked up by Umbraco.
Package actions have been removed for Umbraco 9.
For doing something similar have a look at the Package migration Documentation.
Adding actions to a packageIn the package section once you try to create a package there is a section at the bottom called Package Actions
. It looks like this when not configured:
To add an action you need to add it between the <actions>
elements. Could look like this:
<actions> <Action runat="install" alias="publishRootDocument" documentName="Home" /> </actions>Standard fields on all actions
All actions are an <Action>
node element (notice the uppercase A).
Allows a Document Type to be created below another Document Type. Ex: Allow TextPage
to be allowed under HomePage
.
Alias: allowDocumentType
<Action runat="install" alias="allowDocumentType" documentTypeAlias="TextPage" parentDocumentTypeAlias="HomePage"/>Publish root document
Publishes a document located in the root of the website. Ex: Your package contains a root node called Home
, this will publish it.
Alias: publishRootDocument
<Action runat="install" alias="publishRootDocument" documentName="Home" />
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4