|
1 | 1 | # Umbraco.Community.BackOfficeOrganiser |
2 | 2 |
|
3 | | -[](https://marketplace.umbraco.com/package/umbraco.community.backofficeorganiser) |
4 | | -[](https://github.com/jcdcdev/Umbraco.Community.BackOfficeOrganiser/blob/main/LICENSE) |
5 | | -[](https://www.nuget.org/packages/Umbraco.Community.BackOfficeOrganiser/) |
| 3 | +[](https://marketplace.umbraco.com/package/Umbraco.Community.BackOfficeOrganiser) |
| 4 | +[](https://github.com/jcdcdev/Umbraco.Community.BackOfficeOrganiser?tab=MIT-1-ov-file) |
| 5 | +[](https://www.nuget.org/packages/Umbraco.Community.BackOfficeOrganiser) |
| 6 | +[](https://jcdc.dev/umbraco-packages/back-office-organiser) |
6 | 7 |
|
7 | | -Is your backoffice a bit untidy? |
| 8 | + |
| 9 | +Is your Backoffice a bit untidy? |
8 | 10 |
|
9 | 11 | - Single-click (and opinionated) organiser for |
10 | 12 | - Document Types |
11 | 13 | - Media Types |
12 | 14 | - Member Types |
13 | 15 | - Data Types |
14 | 16 |
|
15 | | - |
16 | | - |
17 | | -## Quick Start |
18 | | - |
19 | | -- Go to the backoffice |
20 | | -- Click `Settings` |
21 | | -- Click `Organise` |
22 | | -- Select the types you wish to organise |
23 | | -- Click submit and confirm |
24 | | -- Refresh your page and enjoy a cleaner backoffice ✨ |
25 | | - |
26 | | -## Configuration |
27 | | -Add the following to your `appsettings.json` file |
28 | | - |
29 | | -```JSON |
30 | | - "BackOfficeOrganiser": { |
31 | | - "DataTypes": { |
32 | | - "InternalFolderName": "Internal", |
33 | | - "ThirdPartyFolderName": "Third Party", |
34 | | - "CustomFolderName": "Custom" |
35 | | - } |
36 | | - } |
37 | | -``` |
38 | | - |
39 | | -## Extending |
40 | | - |
41 | | -You can implement your own `Organise Action`, a method that determines where a type should be moved to. Implement the following interfaces: |
| 17 | +> [!WARNING] |
| 18 | +> Version 12 is no longer supported and is End of Life (EOL). |
42 | 19 |
|
43 | | -- `Document Types` => `IContentTypeOrganiseAction` |
44 | | -- `Media Types` => `IMediaTypeOrganiseAction` |
45 | | -- `Member Types` => `IMemberTypeOrganiseAction` |
46 | | -- `Data Types` => `IDataTypeOrganiseAction` |
| 20 | +> Please review the [security policy](https://github.com/jcdcdev/Umbraco.Community.BackOfficeOrganiser?tab=security-ov-file#supported-versions) for more information. |
47 | 21 |
|
48 | | -### Example |
49 | | -```csharp |
50 | | -using jcdcdev.Umbraco.Core.Extensions; |
51 | | -using Umbraco.Cms.Core.Models; |
52 | | -using Umbraco.Cms.Core.Services; |
53 | | - |
54 | | -namespace Umbraco.Community.BackOfficeOrganiser.Organisers.ContentTypes; |
55 | | - |
56 | | -public class ExampleContentTypeOrganiseAction : IContentTypeOrganiseAction |
57 | | -{ |
58 | | - // Handle all but container types (Folders) |
59 | | - public bool CanMove(IContentType contentType, IContentTypeService contentTypeService) => !contentType.IsContainer; |
60 | | - |
61 | | - public void Move(IContentType contentType, IContentTypeService contentTypeService) |
62 | | - { |
63 | | - var folderId = -1; |
64 | | - var folderName = string.Empty; |
65 | | - var isComposition = contentTypeService.GetComposedOf(contentType.Id).Any(); |
66 | | - |
67 | | - if (contentType.AllowedTemplates?.Any() ?? false) |
68 | | - { |
69 | | - folderName = "Pages"; |
70 | | - } |
71 | | - else if (isComposition) |
72 | | - { |
73 | | - folderName = "Compositions"; |
74 | | - } |
75 | | - else if (contentType.IsElement) |
76 | | - { |
77 | | - folderName = "Element Types"; |
78 | | - } |
79 | | - |
80 | | - if (!folderName.IsNullOrWhiteSpace()) |
81 | | - { |
82 | | - folderId = contentTypeService.GetOrCreateFolder(folderName).Id; |
83 | | - } |
| 22 | +## Contributing |
84 | 23 |
|
85 | | - contentTypeService.Move(contentType, folderId); |
86 | | - } |
87 | | -} |
| 24 | +Contributions to this package are most welcome! Please visit the [Contributing](https://github.com/jcdcdev/Umbraco.Community.BackOfficeOrganiser/contribute) page. |
88 | 25 |
|
89 | | -public class Composer : IComposer |
90 | | -{ |
91 | | - public void Compose(IUmbracoBuilder builder) |
92 | | - { |
93 | | - // Make sure you register your action BEFORE the default! |
94 | | - builder.ContentTypeOrganiseActions().Insert<ExampleContentTypeOrganiseAction>(); |
95 | | - } |
96 | | -} |
97 | | -``` |
| 26 | +## Acknowledgements (Thanks) |
98 | 27 |
|
99 | | -## Contributing |
| 28 | +- LottePitcher - [opinionated-package-starter](https://github.com/LottePitcher/opinionated-package-starter) |
100 | 29 |
|
101 | | -Contributions to this package are most welcome! Please read the [Contributing Guidelines](https://github.com/jcdcdev/Umbraco.Community.BackOfficeOrganiser/blob/main/.github/CONTRIBUTING.md). |
102 | 30 |
|
103 | | -## Acknowledgments (thanks!) |
104 | 31 |
|
105 | | -- LottePitcher - [opinionated-package-starter](https://github.com/LottePitcher/opinionated-package-starter) |
0 commit comments