Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow specifying "root" page in Page List block #33883

Closed
brylie opened this issue Aug 4, 2021 · 1 comment
Closed

Allow specifying "root" page in Page List block #33883

brylie opened this issue Aug 4, 2021 · 1 comment
Labels
[Block] Page List Affects the Page List Block [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed

Comments

@brylie
Copy link
Contributor

brylie commented Aug 4, 2021

What problem does this address?

Related to #31063

It would be useful to be able to specify the "root" page in a page list so that only children of that page would render in the list. For example, when allowing users to navigate within a section of a website where the sibling pages are all relevant.

Similarly, it would be useful to control the depth rendered in the list.

What is your proposed solution?

Basically, the Gutenberg Page List block should emulate the wp_list_pages method, allowing users to specify the child_of, depth, and other related properties.

In PHP, the code for rendering sibling pages

<?PHP
     $parent = get_parent_page();

     wp_list_pages(
          array(
               'child_of'  => $parent,
               'show_date' => '',
               'depth'     => 3,
               'title_li'  => '',
          )
     );

?>
@talldan
Copy link
Contributor

talldan commented Aug 5, 2021

I think there are existing issues for this - #31063 and #29585, so I'll close this one as a duplicate.

Thanks for reaching out though.

edit: Oh, I see this is slightly different. Still, I think it'd be worth rolling this into #31063 as it's so similar. I'll add a comment there.

@talldan talldan closed this as completed Aug 5, 2021
@talldan talldan added [Block] Page List Affects the Page List Block [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed labels Aug 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Page List Affects the Page List Block [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed
Projects
None yet
Development

No branches or pull requests

2 participants