8

Looking to explore solutions for ordering entries in a channel. My current ideas are:

For example purposes let's say this is for recipes and the client wants to be able to pick the order of recipes by some method other than changing the date of the recipe.

1. Add a matrix field, with blocks as entry fields ( for recipes channel ) on the single section (recipes index), where you can select and reorder the entries. Then loop over matrix field to print out the recipes in that order.

Pros: Very easy drag and drop sort.

Cons: Every time a new recipe is added, it as to be manually added to the matrix field.

2. Add a custom field to the recipe channel entry as an integer. Use that integer to sort the entries.

Pros: No extra field on a single section that is somewhat de-coupled from the recipe channel.

Cons: As far as I could find, there is no way to add a column to the entries overview page on the backend of Craft, so you would have to go into each entry and make sure to not have duplicates of the same number. If you wanted to add a new entry at spot 5, and you already had 10 entries, that would be very tedious.

We are brainstorming today, and thinking about what we could make plugin-wise that may add this kind of functionality as well. Will post more info if I come with anything else.

1 Answer 1

18

I'd suggest changing the Recipe section to a "Structure" section type.

enter image description here

This lets the client order the entries with a drag and drop from the Entries tab where they can see the whole list of entries during the reordering.

enter image description here

11
  • 1
    I was just going to recommend that!
    – Siebird
    Jun 26, 2014 at 16:35
  • 1
    Nice. This could work for sure. I'm going to leave this open for another 30 or so to see if any other answers come through. I would guess we will take this approach though. Jun 26, 2014 at 16:44
  • 1
    I think this makes the most sense. We are still new to Craft and wrapping our head around it. Didn't realize that the relational part of structures was optional :) Jun 26, 2014 at 17:06
  • I'm using it on my current project to allow the client to easily order photos on their gallery page. So much easier than adjusting a date or an "order" field in the entry. Jun 26, 2014 at 17:42
  • 1
    @KellyCook you no longer need to have Craft Pro to use Structures (craftcms.com/pricing)
    – Mike Vaux
    Oct 20, 2016 at 8:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.