Skip to content

Commit cc4f8a8

Browse files
authored
Merge pull request #945 from swierczek/automatically-open-modal
Add advanced example to automatically open a modal
2 parents ad7bd3d + 9c335a7 commit cc4f8a8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

docs/development/services/modal.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,18 @@ Finally, we need to create our Bulk Action Controls with some special data attri
130130

131131
Now when a user selects some content in the table, the bulk action controls should appear, and when "Remove" is selected and submitted, a modal will appear showing a list of content about to be deleted, where they can then confirm the deletion and your `POST` handler will be fired.
132132

133+
## Advanced functionality
134+
135+
### Automatically open a modal
136+
137+
If you manually build a modal view, you can add `.app-modal` and a `rev` attribute like:
138+
139+
<div class="modal-wrap app-modal" rev="my-automatic-modal">
140+
141+
Then, visiting the CP page with `#my-automatic-modal` in the URL will automatically open this modal on page load.
142+
143+
NOTE: Note: the `rev` value must be longer than 5 characters in order for this to work. `#test` would not work, but `#testing` would.
144+
133145
## CP/Modal Service Methods
134146

135147
**class `ExpressionEngine\Service\Modal\ModalCollection`**

0 commit comments

Comments
 (0)