We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

REEOrder Module (Custom ordering of entries)

Development and Programming

Cocoaholic's avatar
Cocoaholic
445 posts
18 years ago
Cocoaholic's avatar Cocoaholic

The REEOrder module allows you to easily re-order your entries.

The module uses EE’s ability to order Weblog Entries by a Custom Field, it does not add any queries or other additional processing to your templates.

Installation and usage:

Step 1: Create a new Custom Field in your Field Group, this field will hold the sorting value. You aren’t actually going to use this field. The REEOrder Module will do all the heavy lifting. (The actual sorting.) - The preferred “Field Type” would be “Text Input” - Name it anything you like, and feel free to set any other options

Step 2: Install the “REEOrder” Module

Step 3: In the module’s Preferences page, select the Custom Field you just created.

Step 4: Select a weblog and re-order your entries

Step 5: Create or modify a template and change the “orderby” parameter in the weblog tag to the name of your new Custom Field

Example of the weblog tag:

{exp:weblog:entries weblog="default_site" orderby="your_new_custom_field" disable="categories|member_data|pagination|trackbacks"}

<h3>{title}</h3>
{body}

{/exp:weblog:entries}

If you change Sort Order to “Ascending” in the module’s Preferences, make sure you also add sort”asc” to your weblog tag.

Step 6: (optional) If you like you can install the additional “REEOrder” Extension, this will remove the Custom Field from the Entry Form. (so your client won’t accidentally mess with it).

Let me know if you have any questions.

EDIT: updated to v1.0.1

EDIT 20090203: Thanks to Matt and Brandon you can now sort by drag-and-drop!

EDIT 20090301: updated to v.1.2 This version adds the following:

  • Matt and Brandon’s drag-n-drop sorting (awesome!)
  • the MSM fix mentioned by “agun” (on page 4)
  • the ability to only show (and sort) certain statuses (as requested by Low)
  • the ability to filter out weblogs that haven’t been assigned a custom order field (as requested by Hambo)

Version 1.2 requires the “jQuery for the Control Panel” extension to be installed and activated!

Download: REEOrder Module 1.2

       
Cocoaholic's avatar
Cocoaholic
445 posts
18 years ago
Cocoaholic's avatar Cocoaholic

If you downloaded the module before this post and are getting a MySQL error when installing the extension, please download it again.

:red:

       
Rob Quigley's avatar
Rob Quigley
236 posts
18 years ago
Rob Quigley's avatar Rob Quigley

This is pretty cool. I’ve been playing around with it. I’d love to see the different ways people would use this. I added multiple “orderby” and “sort” criteria so that it first sorts by number and then by date. I pictured using this in cases where one could rearrange a listing of entries on occasion but otherwise have it list in descending order as usual. The automatic sorting feature in the module area is interesting. I’m curious what this was specifically designed for? To me its kind of like a linklist that you could rearrange quite easily.

       
Cocoaholic's avatar
Cocoaholic
445 posts
18 years ago
Cocoaholic's avatar Cocoaholic

Hi Rob,

The module was designed to make it possible to easily rearrange entries in a custom order.

This thread lists some of the ways to accomplish thit but I found that none of these methods were clientproof 😉

Keeping in mind that the module only works with weblog entries, it could be useful for:

  • rearranging titles based on length, like this list
  • rearranging blocks on a homepage
  • sidebars (banners, etc.)
  • custom navigation
  • linklists
  • FAQ’s

Anything you want to give a custom order really.

What do you mean by “The automatic sorting feature in the module area”? The way it sorts, or how it looks?

Thanks for the feedback!

       
Rob Quigley's avatar
Rob Quigley
236 posts
18 years ago
Rob Quigley's avatar Rob Quigley
What do you mean by “The automatic sorting feature in the module area”? The way it sorts, or how it looks?

I like how it looks, but I was referring to the sorting. I’m impressed with the functionality of how it automatically resorts (assigns new sort order numbers based on the number of items) when you click the up/down arrows to move the item up or down.

       
Linda A's avatar
Linda A
647 posts
18 years ago
Linda A's avatar Linda A

I find that I am a little confused about just how this module works, and how it is different from just setting the orderby to a custom field … but that’s likely down to my brain having been unusually slow of late. ;P

I do wonder if it might be able to help me with a couple of issues, however. Both are related to the problem of 1, 5, 10 coming out as 1, 10, 5 when sorted by EE.

Scenario 1: An EE ‘webring’ where each site receives a numerical ID and this custom field is used for ordering. Unless I create one field for sorting and another field for display and for use in the segments (the ID is used as a third segment for a couple of templates, to determine Next & Previous site), I end up with the wrong sorting order.

Scenario 2: A FAQ where the entries are tagged with section numbers along this line: 1.1, 1.1.1., 1.2.1, etc. Here, too, I am currently using one field for sorting (there the numbers are stored as 01.01, 01.01.01, 01.02.01, etc) and one for display, which I’d love to avoid.

       
noregt's avatar
noregt
360 posts
18 years ago
noregt's avatar noregt

Great tool!

It’s perfect when you have a weblog that has nothing to do with a weblog, but is more a kind of an electronic brochure. You could of course sort it by date but this is better I think.

One thing I’d like to see: The module doen’t show categories an entry belongs to, I know this is difficult since an entry can belong to different categories. Maybe mention all categories that an entry belongs to?

The other way around would be a category tree where you could see all entries and the branches it belongs to, but that’s a different module I guess. (almost the pages module…)

PS: what helps for the client is to put the custom field number in the template like:

{if member_group=='1'} reeoder nr {custom_field} {/if}

       
Mikee Bee's avatar
Mikee Bee
179 posts
18 years ago
Mikee Bee's avatar Mikee Bee

I’ve noticed that my entries are going in to the REE-order module different to the edit menu. I installed the module to move one entry around I’m using it for this site and the entries have to be a specific order and my client had left one out! I have it all set up to be ascending, does this explain why the entries are going into REEorder this way?

I have attached a screen shot to show you what I mean.

Thanks

       
Cocoaholic's avatar
Cocoaholic
445 posts
18 years ago
Cocoaholic's avatar Cocoaholic

Correct,

When you add a new entry, the custom order field is still empty. You need to re-order your entries to update that empty field.

As you can see the first three entries in your list do not have a sort order yet, that is why they are listed first, and in your case ascending. If you set your weblog tag to this same order and ascending it will look the same in your template.

So what exactly is your question? 😊

Is the module behaving differently than you expected, or do you want to make sure new entries do not show on your website unless you re-ordered them? something else?

       
Mikee Bee's avatar
Mikee Bee
179 posts
18 years ago
Mikee Bee's avatar Mikee Bee

I think I was hoping that the entries would be added to the ordered-by-reorder list i.e. (as per image) TEST was listed as number 1 then MARLBOROUGH AS 2 Then DENHAM as 3 etc. Can you have it so that they are automatically to the REE-order list? So they are added to the top of the list, Like an automatic update feature?

Sorry for my inability to explain myself properly! I’m having trouble walking and talking at the same time today!!

       
Cocoaholic's avatar
Cocoaholic
445 posts
18 years ago
Cocoaholic's avatar Cocoaholic

I’ll look into some form of ‘automatic update’ feature to re-order all entries when adding a new entry.

However, I think that in your case it might be easier to just sort entries by date.

       
Mikee Bee's avatar
Mikee Bee
179 posts
18 years ago
Mikee Bee's avatar Mikee Bee

Yeah I think you’re right. Thanks for your help

       
MediaGirl Inc.'s avatar
MediaGirl Inc.
186 posts
18 years ago
MediaGirl Inc.'s avatar MediaGirl Inc.

It would be great to be able to hide weblogs from the list if needed so the client will only see the weblogs where they can order entries.

       
Cocoaholic's avatar
Cocoaholic
445 posts
18 years ago
Cocoaholic's avatar Cocoaholic

Sounds like a nice feature, I’ll look into it.

       
MediaGirl Inc.'s avatar
MediaGirl Inc.
186 posts
18 years ago
MediaGirl Inc.'s avatar MediaGirl Inc.

Great! I’m happy to test it if you build it:)

       
1 2 3 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.