Skip to content

jcdcdev/Umbraco.Community.SimpleContentApps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

75 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Umbraco.Community.SimpleContentApps

Umbraco Marketplace GitHub License NuGet Downloads Project Website

This packages aims to help developers quickly put together Umbraco ContentApps using C# only.

Looking for Umbraco 14+ Content Apps? Check out Umbraco.Community.SimpleWorkspaceViews

Basic ContentApp in the Umbraco Office

Features

  • Simplifies C# based ContentApp creation
  • Supports both Views & View Components
  • No package.manifest or lang/lang.xml files required!
  • Variant support (culture specific names)
  • Easy to define Access Rules

Quick Start

Install Package

dotnet add package Umbraco.Community.SimpleContentApps 

Register ContentApp

using Umbraco.Cms.Core.Dashboards;
using Umbraco.Cms.Core.Models.ContentEditing;
using Umbraco.Community.SimpleContentApps.Core;

namespace Umbraco.Community.SimpleContentApps.TestSite;

public class BasicContentApp : ISimpleContentApp
{
    public string Icon => Cms.Core.Constants.Icons.Content;
    public bool ShowInContent => true;
    public bool ShowInContentType => false;
    public bool ShowInMedia => false;
    public bool ShowInMembers => false;
    public IAccessRule[] Rules => new[] { SimpleAccessRule.AllowAdminGroup };
    public int Weight => 0;
    public string Name => "Basic Content App";
    public string? CultureName(string? currentUiCulture) => Name;
    public ContentAppBadge? Badge => ContentAppBadges.None;
}

Create View

  • Your view must go in /Views/ContentApps
  • You view must be the name of your C# class (without ContentApp)
    • For example: BasicContentApp.cs => /Views/ContentApps/Basic.cshtml
@using Umbraco.Community.SimpleContentApps.Core.Extensions
@inherits Umbraco.Community.SimpleContentApps.Web.SimpleContentAppViewPage

<h1>Hello Umbraco</h1>
<p>My ContentApp alias is: @Model.ContentApp.Alias()</p>

More Examples

docs/examples.md

Contributing

Contributions to this package are most welcome! Please read the Contributing Guidelines.

Acknowledgments (thanks!)