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