New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open / collapsed Input fields on New Pages (Editing interface) #1372
Comments
In ProcessWire there's no differentiation between first time edit and subsequent edits. ProcessPageAdd does create the page and then forwards to ProcessPageEdit, which cannot know if the page was already edited or not. |
@LostKobrakai is right that ProcessPageEdit only works with pages that already exist and thus doesn't differentiate between pages that were just created or have already existed. Though I'll leave this open as a feature request because it could potentially support alternate logic for unpublished pages, which ProcessPageEdit does recognize. Though I think this may be getting into very specific use cases and over-configuration for most, so something that I think would better be supported/configured with a hook. |
Another way to approach this (I do not know the ProcessPageAdd and ProcessPageEdit objects): The difference between 1) creating a new Page and 2) editing an existing Page is that no $page->id exists in the first case -- perhaps that can be used when/if designing the feature somewhere down the road. |
You cannot get to the edit screen before a page has an id. ProcessPageAdd is the screen where you just enter the title and the name of an page, after that the page is fully created. ProcessPageAdd then passes to page to ProcessPageEdit, which shows the whole page's edit form, which doesn't know if it's a "new" page or an old one. |
Feature request:
Input fields in Processwire can be configured to be open or collapsed in certain scenarios. This all good sense in many situations.
But when creating a new page it sometimes makes sense to make the page behave in another way (compare to editing an existing page).
For instance, I often use the Basic-Page template with an Image field for both "Articles" (often without photos) and "Images Galleries" (with multiple photos). If the page is an Article without photo, I prefer to collapse the Image input field when editing the existing page -- this is easily achieved using the "collapsedBlank" option.
But when creating a new page, I do not yet know if it will be an Article page or a Gallery page. In this scenario, it would be preferable to be able to specify that all fields shall be expaned.
Reference
Input field collapse options reference (as seen in the editing interface):
"How should this field be displayed in the editor?"
The text was updated successfully, but these errors were encountered: