Hi @mcian,
Could you please clarify more about your scenario. We didn’t get your point.
If I am not wrong, You created Up/Down vote as a pattern and that pattern you used on 3 pages, But when user do vote in all pages, its count only one vote for last page? Am I right ?
Thanks
Hey,
i think i found it: when adding “Vote” to a page manually, it works (each page has its own vote counter). When adding it by an unsynced reuasable, it does not work (each page has the SAME counter). Thats because you encode it using “pollClientId”:”896c7de4-ff68-4a6c-9806-…
Is that the same for all other functions as well? Cant i use them as non-synced reusables?
Marc
Hi @mcian,
This is actually a default block behaviour. The unsynced patterns just keep the reference on the editor. So it’s hard to track the poll ID and render the polls. So when you use it as a pattern, it will work only for one poll for all pages. Not each page has with different poll. For using a different poll for a different page, you need to add that poll separately
Thanks
@wprigel
Actually, this is not correct. Correct is that synced (!) patterns should use the same ID, unsynced should create NEW ID upon insertion, else they would refer to the original (synced). So your plugin need to hook to insertBlocks() https://developer.ww.wp.xz.cn/block-editor/reference-guides/data/data-core-block-editor/