Replies: 4 comments
-
One possible option 4 could be: try moving the code for the slide-out sidebar and mobile menu to the bottom of the page in the theme, instead of being at the top. It could result in more predictable behaviour (what you see in the editor is what you see on the front-end); though there still might be some unexpected de-duplication on the front end ("I want the latest posts showing up in the slide-out side-bar; why aren't they?") it also could be the lesser of two evils (AKA lesser of two weird de-dupe experiences). Edited to add: I still think we need to discourage this overall -- on the off-chance someone is using one of our blocks in the slide-out sidebar area of the theme and including it in the mobile menu, you're still going to get different sets of posts (since on a technical level, it's two blocks, so the same posts can't show in both 😞 ). This suggestion is mostly to improve the WYSIWYG experience for the homepage itself. |
Beta Was this translation helpful? Give feedback.
-
Yet another possible option 5 could be to add a new option to Homepage Posts and Post Carousel blocks to toggle on or off deduplication. It would be on by default, so no change in behavior, but if turned off the block will simply run the query according to block attributes while ignoring other block instances on the page, and not be factored into deduplication for other block instances. This might give editors a bit more control over the behavior and would solve for the scenario @laurelfulford outlines above (putting the "same" block in the slide-out sidebar and mobile menu but not being able to show the same posts in both areas). |
Beta Was this translation helpful? Give feedback.
-
This has come up well before there were widget blocks, so it would be helpful beyond that, too! |
Beta Was this translation helpful? Give feedback.
-
Any solution to this might be largely impacted by to change to Full Site Editing. |
Beta Was this translation helpful? Give feedback.
-
There is a use case scenario which should be fairly rare but is definitely possible and potentially quite confusing. To illustrate, do the following:
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:
Beta Was this translation helpful? Give feedback.
All reactions