Auto-incrementing field?

Title may be slightly misleading as I’m not exactly after an auto-increment, but - I’m currently prototyping a webcomic site and I’ve got a content type of ‘page’ for a comic page. On that, there’s a ‘position’ field that’s a unique number, so the page with the position of 1 is the first page etc. This works fine, but if I want to go back and add new pages in in any position other than last, I’ve got to then go through and update every other one. E.g. I’ve created pages 1 through 12, but I want to go back and add an intro page in position 1, page one has to be edited to be position 2 and so on.

I’m wondering if there’s a better way of doing this where something will automatically bump up everything else if I try to replace it, or some other way of ordering the entries? Is there an inherent order for the posts that I can then access and edit to reorder them? Any ideas welcome, thanks

1 Like

Maybe I’m missing something but if the point is to combine your “pages” into a “comicbook” then wouldn’t you be better served to create a content type for “comic book” and in that content type reference all the pages you want to include?

That way the pages aren’t numbered in the CMS but rather in the application. If you at some point update the included pages in your “comic book” the numbering will also be updated since the order of the references changed.

Does that make sense?

1 Like

Yep, thats actually what I ended up doing - I might change it so there’s a ‘comic’ that links to ‘chapters’ that then links to the pages, otherwise it might get a bit messy if there ends up being hundreds of pages. Thanks for the response!