getgrav / grav

Modern, Crazy Fast, Ridiculously Easy and Amazingly Powerful Flat-File CMS powered by PHP, Markdown, Twig, and Symfony
https://getgrav.org
MIT License
14.55k stars 1.41k forks source link

Sorting not working for modules (modular page) - Grav default theme #2478

Open nicolasp9-dev opened 5 years ago

nicolasp9-dev commented 5 years ago

Hi,

I have a modular page and some submodules of different kinds with numeric prefix enabled on every modules. (01._phase1, 02._adapted-services, 03._android-things, 04._control-interfaces, 05._custom-build, 06._deployment...)

When I sort modules with the following configuration in the parent page:

content:
    items: '@self.modular'
    order:
        by: default
body_classes: modular

Modules are not displayed in the correct order while loading the page. Sorting by title does not work either. However, modules list is in the correct order on the admin page.

Is it a bug or is there something I missed?

Best regards, Nicolas

godfatherjohn commented 5 years ago

Is there a reason that you try to number modular folders? Usually, numbered folders are for those pages that are to be shown in the menu. Modular folders should start with an underscore, not with a number. It wouldn't make sense to number them as you can set their order in the modular.md file.

Here is an example of what the content in your directory would look like: 01.subpage.one.folder 02.subpage.two.folder 03.subpage.three.folder 04.subpage.four.folder _pageheader _pagebody _pagefooter modular.md

The modular folders starting with '_' hold the content of your current page, the numbered folders are the folders of respective subpages. They can contain modular folders themselves.