Add the possibility to save and create a new page - #783
Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request adds a "Save and create new" feature to the page editor that allows users to save the current page and immediately open a modal to create a new page, streamlining the workflow for creating multiple pages.
Key changes:
- Restructured the editor save button UI to always show a dropdown with save options
- Added a new "Save and create new" option that preserves the
createNewquery parameter through the save flow - JavaScript cleanup to remove the query parameter from the URL after the modal is opened
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| panel/views/pages/editor.php | Restructured save button UI to always include a dropdown menu with a new "Save and create new" option |
| panel/translations/en.yaml | Added translation key for the new "Save and create new" button text |
| panel/src/ts/components/views/pages.ts | Added logic to clean up the createNew query parameter from the URL after processing |
| formwork/src/Panel/Controllers/PagesController.php | Implemented backend logic to handle the createNew query parameter and open the new page modal after saving |
馃挕 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| panel.pages.renameFile.name: Name | ||
| panel.pages.replaceFile: Replace file | ||
| panel.pages.save: Save | ||
| panel.pages.saveAndCreateNew: Save and create new |
There was a problem hiding this comment.
The new translation key panel.pages.saveAndCreateNew is only added to the English translation file. This translation should also be added to all other language files (de.yaml, es.yaml, fr.yaml, it.yaml, nl.yaml, pl.yaml, pt.yaml, ro.yaml, ru.yaml, uk.yaml) to maintain consistency across all supported languages.
This pull request introduces a new "Save and create new" feature to the page editor, allowing users to quickly save their current page and immediately start creating a new one. It also includes UI and backend changes to support this workflow, along with minor improvements to the modal and translation files.
New "Save and create new" workflow:
PagesController.phpto handle thecreateNewquery parameter, open the new page modal automatically when appropriate, and ensure redirects preserve the new workflow. [1] [2]Frontend improvements:
createNewquery parameter from the URL after opening the modal, preventing unwanted repeated modal openings on refresh.Localization: