@antibusy/strapi-plugin-content-manager-sort 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +115 -0
- package/dist/_chunks/en-B4KWt_jN.js +4 -0
- package/dist/_chunks/en-Byx4XI2L.mjs +4 -0
- package/dist/admin/index.js +780 -0
- package/dist/admin/index.mjs +763 -0
- package/dist/admin/src/components/Initializer.d.ts +5 -0
- package/dist/admin/src/components/PluginIcon.d.ts +2 -0
- package/dist/admin/src/components/SubNavInjector.d.ts +35 -0
- package/dist/admin/src/index.d.ts +10 -0
- package/dist/admin/src/pages/App.d.ts +2 -0
- package/dist/admin/src/pages/HomePage.d.ts +2 -0
- package/dist/admin/src/pluginId.d.ts +1 -0
- package/dist/admin/src/utils/getTranslation.d.ts +2 -0
- package/dist/server/index.js +84 -0
- package/dist/server/index.mjs +85 -0
- package/dist/server/src/bootstrap.d.ts +5 -0
- package/dist/server/src/config/index.d.ts +5 -0
- package/dist/server/src/content-types/index.d.ts +2 -0
- package/dist/server/src/controllers/controller.d.ts +8 -0
- package/dist/server/src/controllers/index.d.ts +9 -0
- package/dist/server/src/destroy.d.ts +5 -0
- package/dist/server/src/index.d.ts +67 -0
- package/dist/server/src/middlewares/index.d.ts +2 -0
- package/dist/server/src/policies/index.d.ts +2 -0
- package/dist/server/src/register.d.ts +5 -0
- package/dist/server/src/routes/content-api.d.ts +9 -0
- package/dist/server/src/routes/index.d.ts +27 -0
- package/dist/server/src/services/index.d.ts +12 -0
- package/dist/server/src/services/service.d.ts +11 -0
- package/package.json +112 -0
package/README.md
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Content Manager Sort Strapi Plugin
|
|
2
|
+
|
|
3
|
+
Automatically groups related content types in the Strapi Content Manager sidebar into collapsible subnavigation sections based on name patterns.
|
|
4
|
+
|
|
5
|
+
## Package Moved
|
|
6
|
+
|
|
7
|
+
The package has moved from `strapi-plugin-cm-subnav-stacker` to `@xbstracts/strapi-plugin-content-manager-sort`. Please use the new package name for future installs and updates.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
Install the plugin via npm:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install strapi-plugin-content-manager-sort
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Then enable the plugin in your `config/plugins.ts` (see Configuration section below).
|
|
18
|
+
|
|
19
|
+
## Features
|
|
20
|
+
|
|
21
|
+
- Automatically organizes content types with common prefixes/patterns into grouped sections
|
|
22
|
+
- Configurable delimiter for parsing content type names
|
|
23
|
+
- Multiple UI template options for different visual styles
|
|
24
|
+
- Seamless integration with Strapi v5 Content Manager
|
|
25
|
+
|
|
26
|
+
## Configuration
|
|
27
|
+
|
|
28
|
+
Add the plugin to your `config/plugins.ts`:
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
'content-manager-sort': {
|
|
32
|
+
enabled: true,
|
|
33
|
+
config: {
|
|
34
|
+
delimiter: env(
|
|
35
|
+
'CONTENT_MANAGER_SORT_DELIMITER',
|
|
36
|
+
' | '
|
|
37
|
+
),
|
|
38
|
+
template: env(
|
|
39
|
+
'CONTENT_MANAGER_SORT_TEMPLATE',
|
|
40
|
+
'v5'
|
|
41
|
+
),
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Configuration Options
|
|
47
|
+
|
|
48
|
+
#### `delimiter`
|
|
49
|
+
|
|
50
|
+
**Type:** `string`
|
|
51
|
+
**Default:** `' | '`
|
|
52
|
+
|
|
53
|
+
The string used to separate the grouping subject from its items in content type names.
|
|
54
|
+
|
|
55
|
+
**Example:**
|
|
56
|
+
- Content types named `Product | Category`, `Product | Family`, `Product | Component` will be grouped under "Product"
|
|
57
|
+
- The delimiter `' | '` splits the name to determine the group
|
|
58
|
+
|
|
59
|
+
#### `template`
|
|
60
|
+
|
|
61
|
+
**Type:** `'accordion' | 'official' | 'v5'`
|
|
62
|
+
**Default:** `'v5'`
|
|
63
|
+
|
|
64
|
+
The UI template style for displaying grouped navigation items.
|
|
65
|
+
|
|
66
|
+
**Available Templates:**
|
|
67
|
+
|
|
68
|
+
- **`accordion`** - Uses Strapi Design System accordion styling with expandable/collapsible sections
|
|
69
|
+
- **`official`** - Uses the official Strapi navigation style
|
|
70
|
+
- **`v5`** - Respects Strapi v5 subnavigation styling (recommended)
|
|
71
|
+
|
|
72
|
+
## Usage
|
|
73
|
+
|
|
74
|
+
Once configured, the plugin will automatically detect content types that share common prefixes (based on your delimiter) and group them into collapsible sections in the Content Manager sidebar.
|
|
75
|
+
|
|
76
|
+
### Naming Convention
|
|
77
|
+
|
|
78
|
+
Structure your content type names using the delimiter pattern:
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
GroupName | ItemName
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**Examples:**
|
|
85
|
+
- `Blog | Post`
|
|
86
|
+
- `Blog | Category`
|
|
87
|
+
- `Blog | Tag`
|
|
88
|
+
- `Product | Category`
|
|
89
|
+
- `Product | Subcategory`
|
|
90
|
+
|
|
91
|
+
These will be automatically grouped under "Blog" and "Product" respectively.
|
|
92
|
+
|
|
93
|
+
#### Ordering
|
|
94
|
+
|
|
95
|
+
To control the order of items within a group, prefix the title with `[<number>]`:
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
GroupName | [<number>] ItemName
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**Examples:**
|
|
102
|
+
- `[1] Blog | Category`
|
|
103
|
+
- `[2] Blog | Post`
|
|
104
|
+
- `[3] Blog | Tag`
|
|
105
|
+
|
|
106
|
+
Items will be sorted numerically based on the number prefix within each group.
|
|
107
|
+
|
|
108
|
+
## Environment Variables
|
|
109
|
+
|
|
110
|
+
You can configure the plugin using environment variables in your `.env` file:
|
|
111
|
+
|
|
112
|
+
```env
|
|
113
|
+
CONTENT_MANAGER_SORT_DELIMITER=" | "
|
|
114
|
+
CONTENT_MANAGER_SORT_TEMPLATE=v5
|
|
115
|
+
```
|