You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To include all ancestor slugs in the permalink of an item in the CMS, you can dynamically set the `$permalinkBase` property from the `form()` method of your module controller:
40
40
41
41
```php
42
-
class PageController extends ModuleController
42
+
class PageController extends NestedModuleController
43
43
{
44
44
//...
45
45
46
-
protected function form($id, $item = null)
46
+
protected function form(?int $id, TwillModelContract $item = null): array
You can also define the maximum depth allowed for the module changing the following:
77
+
```php
78
+
protected $nestedItemsDepth = 1;
79
+
```
80
+
Note: a depth of 1 means parent and child.
81
+
82
+
### Working with browser fields
83
+
84
+
By default only a parent item will be visible to the browser field. If you want to show child items when browsing for the module you can set `$showOnlyParentItemsInBrowsers` to false:
85
+
```php
86
+
protected $showOnlyParentItemsInBrowsers = false; // default is true
87
+
```
88
+
74
89
## Parent-child modules
75
90
76
91
Parent-child modules are 2 distinct modules, where items of the child module are attached to items of the parent module (e.g. Issues can contain Articles):
0 commit comments