Grav-plugin-admin: Ordering of modules

Created on 30 May 2016  ·  6Comments  ·  Source: getgrav/grav-plugin-admin

In the gui on the advanced tab of a modular page, enabling Folder Numeric Prefix will definitely rename the directory of the page, prefixing it with a number. (e.g._module-name becomes 01._module-name) However, when enabling it on a peer sub-modular page, it will again prefix the directory but without incrementing the number! All module folders will receive a 01 prefix.

bug

All 6 comments

Cannot recreate. Are you trying Admin 1.1 beta or 1.0? I get 02. prefixed, at the second attempt.

I have the same issue (using Admin v1.1.0-rc.3):

pages/home/modular.md:

---
title: Home
content:
    items: '@self.modular'
    order: default
---

I have two modules:
pages/home/_item_one/text.md and pages/home/_item_two/text.md

If I enable "Folder Numeric Prefix" for each of them, both folders receive a 01 prefix.
Additionally, I can not sort the modules in Admin, I always get the _"Parent setting order, ordering disabled"_ message.

Even worse:
If I manually rename the folders to the correct numerical prefixes (01, 02, ...), once I edit a page and click on "Save", the prefix is reset to 01.

I can recreate the problem now, for some reason I wasn't having it previosuly! So, I can do something now. Also, replicated the rollback to 01 after save.

"Parent setting order, ordering disabled" is normal on child pages. The parent page sets the order, you can do it by setting by data, title, folder name, or manually - but just in expert mode.
You cannot currently drag-and-drop the modular childs, we know it's not ideal but we'll improve this in the future.

The last 2 commits in the Admin plugin repository should fix this problem: https://github.com/getgrav/grav-plugin-admin/commits/develop

@flesser @ritchiedalto can you test it too?

I updated to rc.4 in the backend and it works now. Saving an existing module keeps its index, creating a new module and enabling Folder Numeric Prefix adds a new index n+1.

Thanks for the immediate fix!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

illycz picture illycz  ·  5Comments

Quy picture Quy  ·  6Comments

Sommerregen picture Sommerregen  ·  3Comments

darkroastcreative picture darkroastcreative  ·  4Comments

maciejmatu picture maciejmatu  ·  3Comments