Problem
Numerous tests from the Minnesota ones, to the Google one just recently discovered that people do not expect the preview to be shown within their administrative interface. In light of #1510532: [META] Implement the new create content page design , we would like to implement an actual preview of content.
Proposed resolution
- Use the TempStore to store entity objects that are currently being edited.
- When a user clicks "Preview", the entity is written to the entity system's TempStore, and the user is redirected to a full-site preview that loads that particular entity from the TempStore. (Maybe a special query string on the URL & preview-related additions to the entity API.)
- Add some sort of toolbar or visual indicator when the user is in the preview mode (at one of the preview URLs).
- In EntityFormController::prepareEntity(), check for a TempStore record for the entity, and if one is found, load that record into the form if the current user/session is the owner, or do something else if the user is not.
- On entity save, delete the TempStore record and save the entity normally.
API Changes
Probably lots of 'm?
Original report by bojhan:
In light of #1510532: [META] Implement the new create content page design , we would like to implement an actual preview of content. Numerous tests from the Minnesota ones, to the Google one just recently discovered that people do not expect the preview to be shown within their administrative interface.
We can actually make this happen by implementing a "contextual bar" that is shown in place of the shortcut bar that allows you to switch between views and go back to editing. It is similar to the pattern we use for demonstrating block regions, but its now an actual design pattern one can use for previewing - rather than a one-off design idea.