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 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
+ ```
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const en = {};
4
+ exports.default = en;
@@ -0,0 +1,4 @@
1
+ const en = {};
2
+ export {
3
+ en as default
4
+ };