Skip to content

Preview page in CMS #70

Description

@simonrjones

Allow a CMS editor user to view pages on the frontend from WordPress, both when viewing a published page and when viewing an unpublished draft page (preview).

Dependant on #63

Work
Basic functionality:

  • WordPress plugin to view a page in WordPress in the frontend (use API to retrieve frontend URL based on CMS post ID)

Prerequisites for preview functionality:

  • Work out a way to auth against WP REST API from an external location (frontend), e.g. https://wordpress.org/plugins/application-passwords/ or https://wordpress.org/plugins/jwt-authentication-for-wp-rest-api/
  • Create preview URL for frontend (e.g. preview.domain.com) which serves same content but requires authentication
  • Create basic login page for preview URL which should then authenticate. Support two models: 1) CMS (WordPress), 2) stored credentials in .users file (or similar), do not commit to version control
  • WordPress API endpoint to return draft content when authenticated by API token

Preview functionality:

  • WordPress plugin to preview the current page, "Preview" button which does the following:
    • Saves draft content in WP
    • User visits preview domain URL
    • User logs into preview site (via WordPress)
    • Preview site requests draft content from WordPress API
    • Load Preview content into web page and display to user

Activity

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions