|
1 | 1 | # Umbraco.Community.SimpleContentApps |
2 | 2 |
|
3 | | -[](https://marketplace.umbraco.com/package/umbraco.community.simplecontentapps) |
4 | | -[](https://github.com/jcdcdev/Umbraco.Community.SimpleContentApps/blob/main/LICENSE) |
5 | | -[](https://www.nuget.org/packages/Umbraco.Community.SimpleContentApps/) |
| 3 | +[](https://marketplace.umbraco.com/package/Umbraco.Community.SimpleContentApps) |
| 4 | +[](https://github.com/jcdcdev/Umbraco.Community.SimpleContentApps?tab=MIT-1-ov-file) |
| 5 | +[](https://www.nuget.org/packages/Umbraco.Community.SimpleContentApps) |
6 | 6 | [](https://jcdc.dev/umbraco-packages/simple-content-apps) |
7 | 7 |
|
8 | | -This packages aims to help developers quickly put together Umbraco ContentApps using C# only. |
9 | 8 |
|
10 | | -Looking for Umbraco 14+ Content Apps? Check out [Umbraco.Community.SimpleWorkspaceViews](https://github.com/jcdcdev/Umbraco.Community.SimpleWorkspaceViews) |
11 | 9 |
|
12 | | - |
13 | 10 |
|
14 | | -## Features |
15 | | -- Simplifies C# based ContentApp creation |
16 | | -- Supports both Views & View Components |
17 | | -- No package.manifest or lang/lang.xml files required! |
18 | | -- Variant support (culture specific names) |
19 | | -- Easy to define Access Rules |
20 | 11 |
|
21 | | -## Quick Start |
22 | | - |
23 | | -### Install Package |
24 | | -```csharp |
25 | | -dotnet add package Umbraco.Community.SimpleContentApps |
26 | | -``` |
27 | | - |
28 | | -### Register ContentApp |
29 | | - |
30 | | -```csharp |
31 | | -using Umbraco.Cms.Core.Dashboards; |
32 | | -using Umbraco.Cms.Core.Models.ContentEditing; |
33 | | -using Umbraco.Community.SimpleContentApps.Core; |
34 | | - |
35 | | -namespace Umbraco.Community.SimpleContentApps.TestSite; |
36 | | - |
37 | | -public class BasicContentApp : ISimpleContentApp |
38 | | -{ |
39 | | - public string Icon => Cms.Core.Constants.Icons.Content; |
40 | | - public bool ShowInContent => true; |
41 | | - public bool ShowInContentType => false; |
42 | | - public bool ShowInMedia => false; |
43 | | - public bool ShowInMembers => false; |
44 | | - public IAccessRule[] Rules => new[] { SimpleAccessRule.AllowAdminGroup }; |
45 | | - public int Weight => 0; |
46 | | - public string Name => "Basic Content App"; |
47 | | - public string? CultureName(string? currentUiCulture) => Name; |
48 | | - public ContentAppBadge? Badge => ContentAppBadges.None; |
49 | | -} |
50 | | -``` |
51 | | - |
52 | | -### Create View |
53 | | - |
54 | | -- Your view **must** go in `/Views/ContentApps` |
55 | | -- You view **must** be the name of your C# class (without `ContentApp`) |
56 | | - - For example: `BasicContentApp.cs` => `/Views/ContentApps/Basic.cshtml` |
57 | | - |
58 | | -```csharp |
59 | | -@using Umbraco.Community.SimpleContentApps.Core.Extensions |
60 | | -@inherits Umbraco.Community.SimpleContentApps.Web.SimpleContentAppViewPage |
61 | | - |
62 | | -<h1>Hello Umbraco</h1> |
63 | | -<p>My ContentApp alias is: @Model.ContentApp.Alias()</p> |
64 | | -``` |
65 | | - |
66 | | -### More Examples |
67 | | - |
68 | | -[docs/examples.md](https://github.com/jcdcdev/Umbraco.Community.SimpleContentApps/blob/dev/docs/examples.md) |
69 | 12 |
|
70 | 13 | ## Contributing |
71 | 14 |
|
72 | | -Contributions to this package are most welcome! Please read the [Contributing Guidelines](https://github.com/jcdcdev/Umbraco.Community.SimpleContentApps/blob/main/.github/CONTRIBUTING.md). |
| 15 | +Contributions to this package are most welcome! Please visit the [Contributing](https://github.com/jcdcdev/Umbraco.Community.SimpleContentApps/contribute) page. |
| 16 | + |
73 | 17 |
|
74 | | -## Acknowledgments (thanks!) |
75 | 18 |
|
76 | | -- LottePitcher - [opinionated-package-starter](https://github.com/LottePitcher/opinionated-package-starter) |
0 commit comments