Context Apps
Configuring context apps in Umbraco UI Builder.
Context Apps in Umbraco UI Builder function similarly to Content Apps. They provide contextual applications within the content editor UI. By defining context apps, you can expose collections that are directly related to the content in question. For example, blog post comments can be linked to their respective blog posts and managed in context through a content app.

Defining a Context App
You can define a context app by calling one of the AddContextApp
methods on a WithTreeConfigBuilder
instance.
Using the AddContextApp()
Method
AddContextApp()
MethodAdds a context app with the specified name and default icon.
Method Syntax
Example
Using the AddContextApp()
Method with Custom Icon
AddContextApp()
Method with Custom IconAdds a context app with the specified name and custom icon.
Method Syntax
Example
Using the AddContextAppBefore()
Method
AddContextAppBefore()
MethodAdds a context app with the specified name and default icon before another context app specified by its alias.
Method Syntax
Example
Using the AddContextAppBefore()
Method with a Custom Icon
AddContextAppBefore()
Method with a Custom IconAdds a context app with the specified name and custom icon before another context app specified by its alias.
Method Syntax
Example
Using the AddContextAppAfter()
Method
AddContextAppAfter()
MethodAdds a context app with the specified name and default icon after another context app specified by its alias.
Method Syntax
Example
Using the AddContextAppAfter()
Method with a Custom Icon
AddContextAppAfter()
Method with a Custom IconAdds a context app with the specified name and custom icon after another context app specified by its alias.
Method Syntax
Example
Changing a Context App Alias
Using the SetAlias()
Method
SetAlias()
MethodSets the alias of the context app. By default, an alias is automatically generated from the context app's name. You can use the SetAlias
method to specify a custom alias.
Method Syntax
Example
Changing a Context App Icon Color
Using the SetIconColor()
Method
SetIconColor()
MethodSets the context app icon color to the given color. The available colors are: black
, green
, yellow
, orange
, blue
or red
.
Method Syntax
Example
Changing Context App Visibility
Context app visibility is controlled by a delegate that takes a ContextAppVisibilityContext
instance. This method contains a Source
property which holds a reference to the source object that the content app is being displayed on (i.e., an IContent
instance). It also holds a reference to a UserGroups
collection of the currently logged-in user's user groups. You can use these values to determine when the context app should be displayed.
By default, context apps are pre-filtered to only appear on the tree they are defined in. This default behavior is combined with the SetVisibility configuration to control visibility.
Using the SetIconColor()
Method
SetIconColor()
MethodDefines the visibility of the context app based on a delegate expression.
Method Syntax
Example
Adding a Collection to a Context App
Context apps can consist of one or more collections. If a context app contains multiple collections, the collection list views will be displayed in tabs within the context app.
Using the AddCollection<>()
Method
AddCollection<>()
MethodAdds a collection to the current context app with the specified names, descriptions, and default icons. Each collection requires an ID field and a foreign key field, linking to Umbraco node UDI values. For more details, see the Collections article.
Method Syntax
Example
Using the AddCollection<>()
Method with Custom Icon
AddCollection<>()
Method with Custom IconAddCollection<TEntityType>(Lambda idFieldExpression, Lambda fkFieldExpression, string nameSingular, string namePlural, string description, string iconSingular, string iconPlural, Lambda collectionConfig = null) : ContextAppConfigBuilder
Adds a collection to the current context app with the specified names, descriptions, and custom icons. Each collection requires an ID field and a foreign key field, linking to Umbraco node UDI values. For more details, see the Collections article.
Method Syntax
Example
Last updated
Was this helpful?