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

Ordering of modules #628

Closed
ritchiedalto opened this issue May 30, 2016 · 6 comments
Closed

Ordering of modules #628

ritchiedalto opened this issue May 30, 2016 · 6 comments
Assignees
Labels

Comments

@ritchiedalto
Copy link

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.

@flaviocopes
Copy link
Contributor

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

@flesser
Copy link

flesser commented Jun 20, 2016

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.

@flesser
Copy link

flesser commented Jun 20, 2016

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.

@flaviocopes
Copy link
Contributor

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.

@flaviocopes flaviocopes self-assigned this Jun 21, 2016
flaviocopes added a commit that referenced this issue Jun 21, 2016
Re #628 fix issue when saving a modular child folder as 05.something
and being reset to 01.something upon save
@flaviocopes
Copy link
Contributor

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?

@flesser
Copy link

flesser commented Jun 21, 2016

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants