bobbingwide / sb-children-block

List children of the current content as links.
2 stars 0 forks source link

Add depth attribute to children-block #1

Closed bobbingwide closed 4 years ago

bobbingwide commented 4 years ago

I'm trying out different scaffold tools for developing Gutenberg blocks. This plugin ( children-block ) was generated using wp-create-block. https://github.com/WordPress/gutenberg/tree/master/packages/create-block

I now want to extend the block to actually do what I want it to do - display Child content as a list.

The first change, which wasn't done using an issue or PR, was to add ServerSideRendering, using wp_list_pages().

Now I want to start making use of some of the parameters. e.g. depth= which is used to control the levels of descendents displayed.

depth= Meaning
0 Any depth
1 Children
2 Children and grandchildren
n>2 More descendants
-1 Don't show the nesting

Example depth=0

Example depth=1

Example depth=2

Example depth=3

Example depth=-1

The test data is being constructed in my local development environment: see s.b/wp54/children-block-versions/

bobbingwide commented 4 years ago

I'm going to close this even though there are no automated tests.