-
Notifications
You must be signed in to change notification settings - Fork 43
Description
There is a use case scenario which should be fairly rare but is definitely possible and potentially quite confusing. To illustrate, do the following:
- Add some Homepage Posts and/or Post Carousel blocks to several widget areas, including the mobile menu, sidebar, and slide-out sidebar.
- Add several other Homepage Posts and/or Post Carousel blocks to a post or page. Maybe use one of the block patterns which will render many instances and posts.
- View the page on the front-end, observe that the posts shown by the blocks in the page's content differ from what's shown in the editor.
The reason this is happening is deduplication: on the front-end, the instances of these blocks inside widget areas are counted when it comes to deduplication behavior. Some of these widget areas (such as the mobile menu and slide-out sidebar) appear ahead of the post content in the markup, so these blocks are rendered first. In the editor, however, the widgets are not rendered, so their posts are not factored into deduplication.
The above is basically working as expected but creates a confusing/alarming scenario where the posts you're seeing in the editor preview could be really different from what you see on the front-end when the widgets are also rendered. How should we handle this? Some options we threw around but didn't decide on fully:
- Disable the use of Homepage Posts and Post Carousel inside certain widget areas (such as mobile menu and slide-out sidebar): not even sure if this is possible
- Disable deduplication behavior in widget block instances: probably not desirable if using the blocks in the regular sidebar, or after-content/footer areas
- Do not handle this scenario at all: the code is working as intended, and it's more of an education issue than a code issue
- Your suggestions here?