From a58c1f978feab3d314c310cf8ad72725b4255d11 Mon Sep 17 00:00:00 2001 From: Maggie Date: Tue, 9 Jul 2024 14:05:43 +0200 Subject: [PATCH] add example for query block and posts list (#63286) --- packages/block-library/src/query/index.js | 40 +++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/packages/block-library/src/query/index.js b/packages/block-library/src/query/index.js index 8d82391923603e..0a757b8ee11e92 100644 --- a/packages/block-library/src/query/index.js +++ b/packages/block-library/src/query/index.js @@ -19,6 +19,46 @@ export { metadata, name }; export const settings = { icon, edit, + example: { + viewportWidth: 650, + attributes: { + namespace: 'core/posts-list', + query: { + perPage: 4, + pages: 1, + offset: 0, + postType: 'post', + order: 'desc', + orderBy: 'date', + author: '', + search: '', + sticky: 'exclude', + inherit: false, + }, + }, + innerBlocks: [ + { + name: 'core/post-template', + attributes: { + layout: { + type: 'grid', + columnCount: 2, + }, + }, + innerBlocks: [ + { + name: 'core/post-title', + }, + { + name: 'core/post-date', + }, + { + name: 'core/post-excerpt', + }, + ], + }, + ], + }, save, variations, deprecated,