strapi-plugin-cm-subnav-stacker 0.0.1
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 +101 -0
- package/dist/_chunks/en-B4KWt_jN.js +4 -0
- package/dist/_chunks/en-Byx4XI2L.mjs +4 -0
- package/dist/admin/index.js +928 -0
- package/dist/admin/index.mjs +911 -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 +31 -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 +87 -0
package/README.md
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# cm-subnav-stacker
|
|
2
|
+
|
|
3
|
+
Automatically groups related content types in the Strapi Content Manager sidebar into collapsible subnavigation sections based on name patterns.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Automatically organizes content types with common prefixes/patterns into grouped sections
|
|
8
|
+
- Configurable delimiter for parsing content type names
|
|
9
|
+
- Multiple UI template options for different visual styles
|
|
10
|
+
- Seamless integration with Strapi v5 Content Manager
|
|
11
|
+
|
|
12
|
+
## Configuration
|
|
13
|
+
|
|
14
|
+
Add the plugin to your `config/plugins.ts`:
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
'cm-subnav-stacker': {
|
|
18
|
+
enabled: true,
|
|
19
|
+
config: {
|
|
20
|
+
delimiter: env(
|
|
21
|
+
'CM_SUBNAV_STACKER_DELIMITER',
|
|
22
|
+
' | '
|
|
23
|
+
),
|
|
24
|
+
template: env(
|
|
25
|
+
'CM_SUBNAV_STACKER_TEMPLATE',
|
|
26
|
+
'v5'
|
|
27
|
+
),
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Configuration Options
|
|
33
|
+
|
|
34
|
+
#### `delimiter`
|
|
35
|
+
|
|
36
|
+
**Type:** `string`
|
|
37
|
+
**Default:** `' | '`
|
|
38
|
+
|
|
39
|
+
The string used to separate the grouping subject from its items in content type names.
|
|
40
|
+
|
|
41
|
+
**Example:**
|
|
42
|
+
- Content types named `Product | Category`, `Product | Family`, `Product | Component` will be grouped under "Product"
|
|
43
|
+
- The delimiter `' | '` splits the name to determine the group
|
|
44
|
+
|
|
45
|
+
#### `template`
|
|
46
|
+
|
|
47
|
+
**Type:** `'accordion' | 'official' | 'v5'`
|
|
48
|
+
**Default:** `'v5'`
|
|
49
|
+
|
|
50
|
+
The UI template style for displaying grouped navigation items.
|
|
51
|
+
|
|
52
|
+
**Available Templates:**
|
|
53
|
+
|
|
54
|
+
- **`accordion`** - Uses Strapi Design System accordion styling with expandable/collapsible sections
|
|
55
|
+
- **`official`** - Uses the official Strapi navigation style
|
|
56
|
+
- **`v5`** - Respects Strapi v5 subnavigation styling (recommended)
|
|
57
|
+
|
|
58
|
+
## Usage
|
|
59
|
+
|
|
60
|
+
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.
|
|
61
|
+
|
|
62
|
+
### Naming Convention
|
|
63
|
+
|
|
64
|
+
Structure your content type names using the delimiter pattern:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
GroupName | ItemName
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Examples:**
|
|
71
|
+
- `Blog | Post`
|
|
72
|
+
- `Blog | Category`
|
|
73
|
+
- `Blog | Tag`
|
|
74
|
+
- `Product | Category`
|
|
75
|
+
- `Product | Subcategory`
|
|
76
|
+
|
|
77
|
+
These will be automatically grouped under "Blog" and "Product" respectively.
|
|
78
|
+
|
|
79
|
+
#### Ordering
|
|
80
|
+
|
|
81
|
+
To control the order of items within a group, prefix the title with `[<number>]`:
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
GroupName | [<number>] ItemName
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Examples:**
|
|
88
|
+
- `[1] Blog | Category`
|
|
89
|
+
- `[2] Blog | Post`
|
|
90
|
+
- `[3] Blog | Tag`
|
|
91
|
+
|
|
92
|
+
Items will be sorted numerically based on the number prefix within each group.
|
|
93
|
+
|
|
94
|
+
## Environment Variables
|
|
95
|
+
|
|
96
|
+
You can configure the plugin using environment variables in your `.env` file:
|
|
97
|
+
|
|
98
|
+
```env
|
|
99
|
+
CM_SUBNAV_STACKER_DELIMITER=" | "
|
|
100
|
+
CM_SUBNAV_STACKER_TEMPLATE=v5
|
|
101
|
+
```
|