Pages plugin: Sidebar question

Hello,

I have a question about the sidebar navigation of the "Pages" plugin.

When I am on a page and that page has sub-pages, there is a list of those sub-pages in the sidebar on the right side of the page.

As I just found out, that list is restricted to 10 entries.

How can I make that list show ALL sub-pages?

Thanks for any help.

  • Thanks for the reply.

    I checked my "my_plugin" to see what code I changed for the "Pages" plugin. I did the following:

    1. Hide the comment block in the plugin's sidebar.php.

    2. Hide the tag block in the plugin's sidebar.php.

    3. Hide the owner block in the cores' sidebar.php.

    4. Sort the list for the pages:menu_nav alphabetically with the code you provided me with:

    In "my_plugin"'s "elgg-plugin.php" there is:

    'events' => [
            'register' => [
                'menu:pages_nav' => [
                    'Elgg\Pages\Menus\PagesNav::register' => ['unregister' => true],
                    '\MyPlugin\Pages\Menus\PagesNav::register' => ['priority' => 800],
                                    ],
                            ],
                    ],

    And in the new "PagesNav.php" this function is added to the "$next_level_guids = [$top->guid];" part:

    'batch' => true,
    'sort_by' => [
    'property_type' => 'metadata',
    'property' => 'title',
    'direction' => 'ASC',
    ],

    For testing purposes, I just deactivated this, and as a result I got the standard sorting, but it was also limited to 10.

    I don't know where that limit of 10 comes from. How could I investigate this?

    For reference, my sidebar looks like this (there are more wikis after the letter "I"):

  • Sounds like a bug.

    Just only one guess, it comes from Site settings - "Default number of items per page".
    If you have it set to 10, then that's it.

    But there're no limits in 'Pages' plugin, so it's a bug.

  • It indeed seems to come from "Site settings - 'Default number of items per page'."

    For a quick fix, I changed it to 100, as I don't have that many pages in any of the sections yet (e.g. blog, pages, events). But it's not the best solution.

    I'm not sure now if this is working as intended or not. If it's a bug, how/where would I report it?

  • how/where would I report it?

    https://github.com/Elgg/Elgg/issues

    You can temporarily fix this adding 'limit' => false to "PagesNav.php"

    'batch' => true,
    'limit' => false,
    'sort_by' => [
       'property_type' => 'metadata',
       'property' => 'title',
      'direction' => 'ASC',
    ],
    
Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking