Skip to content

Add the possibility to save and create a new page - #783

Merged
giuscris merged 3 commits into
2.xfrom
feature/page-save-and-create
Nov 15, 2025
Merged

Add the possibility to save and create a new page#783
giuscris merged 3 commits into
2.xfrom
feature/page-save-and-create

Conversation

@giuscris

@giuscris giuscris commented Nov 9, 2025

Copy link
Copy Markdown
Member

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:

  • Added a "Save and create new" button to the page editor dropdown, enabling users to save the current page and open the new page modal in a single action. [1] [2]
  • Updated backend logic in PagesController.php to handle the createNew query parameter, open the new page modal automatically when appropriate, and ensure redirects preserve the new workflow. [1] [2]

Frontend improvements:

  • Enhanced the pages view script to clean up the createNew query parameter from the URL after opening the modal, preventing unwanted repeated modal openings on refresh.

Localization:

  • Added a new translation string for the "Save and create new" action in the English language file.

@giuscris giuscris added this to the 2.2.0 milestone Nov 9, 2025
@giuscris
giuscris requested a review from Copilot November 9, 2025 18:47
@giuscris giuscris self-assigned this Nov 9, 2025
@giuscris giuscris added the enhancement New feature or request label Nov 9, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 createNew query 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.

Comment thread formwork/src/Panel/Controllers/PagesController.php
Comment thread formwork/src/Panel/Controllers/PagesController.php Outdated
panel.pages.renameFile.name: Name
panel.pages.replaceFile: Replace file
panel.pages.save: Save
panel.pages.saveAndCreateNew: Save and create new

Copilot AI Nov 9, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@giuscris
giuscris marked this pull request as ready for review November 15, 2025 13:10
@giuscris
giuscris merged commit bcd5eb7 into 2.x Nov 15, 2025
2 checks passed
@giuscris
giuscris deleted the feature/page-save-and-create branch November 15, 2025 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants