aem-guides-wknd-graphql icon indicating copy to clipboard operation
aem-guides-wknd-graphql copied to clipboard

Enable sub page editing for remote spa

Open sharanyavinod opened this issue 4 years ago • 4 comments

Description

  • Sample project updated to illustrate how to enable child pages for editing

Motivation and Context

  • Displays how child page can be directly edited instead of navigating to it from the home page via preview
  • Highlights the importance of spa-aem path mapping

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • [x] I have signed the Adobe Open Source CLA.
  • [x] My code follows the code style of this project.
  • [ ] My change requires a change to the documentation.
  • [ ] I have updated the documentation accordingly.
  • [x] I have read the CONTRIBUTING document.
  • [ ] I have added tests to cover my changes.
  • [ ] All new and existing tests passed.

sharanyavinod avatar Dec 06 '21 15:12 sharanyavinod

@godanny86 As discussed, I have created a rough draft of changes required to enable sub-page editing. A major part of this is ensuring the child page paths are simple and match the AEM project paths.

sharanyavinod avatar Dec 06 '21 15:12 sharanyavinod

@sharanyavinod thanks for the PR! Looking at the updates well need in the tutorial, 2 quick questions

  1. It appears we'll need to add the root SPA URL to the Page Properties of any page that can be opened directly, so something like:

2021-12-17 at 4 49 PM

Should that property value be set in the template's Initial Content so its just on every page by default?

  1. If I open a sub-page directly and edit components via inline editing (at least in Text component), the page goes blank - and seems to have placeholders the components on the page but the SPA visual is gone:

2021-12-17 at 4 54 PM

Is there a workaround for this? Refreshing re-renders the SPA.

These are the 2 outstanding things i noticed - once we get clarity on these we can merge the PR and update the tutorial to match! Thanks again!!

davidjgonzalez avatar Dec 17 '21 21:12 davidjgonzalez

@sharanyavinod bumping this post-holiday question so we can get this merged!

davidjgonzalez avatar Jan 10 '22 17:01 davidjgonzalez

@davidjgonzalez Thank you for the review and apologies for the delay in response. Regarding the first query, indeed that is the behaviour as of now. Hoping to make it simpler as mentioned in the future, but is still to-do at the moment. The second one - I'll take a look at the issue. Is it happening only when we open the subpage directly for editing? Does it work as expected when navigating from the main page?

sharanyavinod avatar Mar 14 '22 12:03 sharanyavinod