Skip to content
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

Open
klor opened this issue Aug 29, 2015 · 4 comments
Open

Open / collapsed Input fields on New Pages (Editing interface) #1372

klor opened this issue Aug 29, 2015 · 4 comments

Comments

@klor
Copy link

klor commented Aug 29, 2015

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?"

  • Always open (default) ("collapsedNo")
  • Always open and cannot be collapsed ("collapsedNever")
  • Collapsed only when blank ("collapsedBlank")
  • Collapsed only when populated ("collapsedPopulated")
  • Always collapsed, requiring a click to open ("collapsedYes")
  • Hidden, not shown in the editor ("collapsedHidden")
  • Always collapsed and not editable (locked) ("collapsedYesLocked")
  • Open when populated and not editable (locked) ("collapsedNoLocked")
@LostKobrakai
Copy link

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.

@ryancramerdesign
Copy link
Owner

@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.

@klor
Copy link
Author

klor commented Sep 22, 2015

Though I'll leave this open as a feature request because it could potentially support alternate logic
for unpublished pages, which ProcessPageEdit does recognize.

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.

@LostKobrakai
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants