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
- This change allows defining blocks without adding them to the `twill.block_editor` configuration
365
365
- This is backwards compatible with blocks already defined in configuration
366
-
- Repeaters are now created in a dedicated folder: `views/admin/repeaters` by default, but your existing repeaters in the `views/admin/blocks` file will still work
366
+
- Repeaters are now created in a dedicated folder: `views/twill/admin/repeaters` by default, but your existing repeaters in the `views/twill/admin/blocks` file will still work
367
367
- Annotations are now supported in blocks and repeaters Blade files:
368
368
- Provide a title with `@twillPropTitle` or `@twillBlockTitle` or `@twillRepeaterTitle`
369
369
- Provide an icon with `@twillPropIcon` or `@twillBlockIcon` or `@twillRepeaterIcon`
Copy file name to clipboardexpand all lines: docs/src/block-editor/creating-a-block-editor.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ By default, adding the `@formField('block_editor')` directive enables all availa
31
31
32
32
#### Create and define blocks
33
33
34
-
Blocks and Repeaters are built on the same Block model and are created and defined in their respective folders. By default, Twill will look for Blade templates in `views/admin/blocks` for blocks and `views/admin/repeaters` for repeaters.
34
+
Blocks and Repeaters are built on the same Block model and are created and defined in their respective folders. By default, Twill will look for Blade templates in `views/twill/admin/blocks` for blocks and `views/twill/admin/repeaters` for repeaters.
35
35
36
36
Note: Prior to Twill version 2.2, Blocks (and Repeaters) needed to be defined in the configuration file – this is no longer necessary and not recommended. This change is backward compatible, so your existing configuration should work as it used to. Defining blocks in the configuration file will be deprecated in a future release (see the section below [Legacy configuration](/block-editor/legacy-configuration-2-2.html).
Once you generated the module using Twill's CLI module generator, it will also prepare the `App/Http/Requests/Admin/ModuleNameRequest.php` for you to use.
9
+
Once you generated the module using Twill's CLI module generator, it will also prepare the `App/Http/Requests/Twill/ModuleNameRequest.php` for you to use.
10
10
You can choose to use different rules for creation and update by implementing the following 2 functions instead of the classic `rules` one:
Copy file name to clipboardexpand all lines: docs/src/settings-sections/index.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ Start by enabling the `settings` feature in your `config/twill.php` configuratio
10
10
11
11
If you did not enable this feature before running the `twill:install` command, you need to copy the migration in `vendor/area17/twill/migrations/create_settings_table.php` to your own `database/migrations` directory and migrate your database before continuing.
12
12
13
-
To create a new settings section, add a blade file to your `resources/views/admin/settings` folder. The name of this file is the name of your new settings section.
13
+
To create a new settings section, add a blade file to your `resources/views/twill/admin/settings` folder. The name of this file is the name of your new settings section.
14
14
15
15
In this file, you can use `@formField('input')` Blade directives to add new settings. The name attribute of each form field is the name of a setting. Wrap them like in the following example:
16
16
@@ -49,7 +49,7 @@ return [
49
49
];
50
50
```
51
51
52
-
Each Blade file you create in `resources/views/admin/settings` creates a new section available for you to add in the `primary_navigation` array of your `config/twill-navigation.php` file.
52
+
Each Blade file you create in `resources/views/twill/admin/settings` creates a new section available for you to add in the `primary_navigation` array of your `config/twill-navigation.php` file.
53
53
54
54
You can then retrieve the value of a specific setting by its key, which is the name of the form field you defined in your settings form, either by directly using the `A17\Twill\Models\Setting` Eloquent model or by using the provided `byKey` helper in `A17\Twill\Repositories\SettingRepository`:
0 commit comments