1 of 5
1
REEOrder Module (Custom ordering of entries)
Posted: 20 February 2007 11:15 AM   [ Ignore ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  879
Joined  02-05-2002

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).

Download: REEOrder Module 1.0.1

Let me know if you have any questions.

EDIT: updated to v1.0.1

 Signature 

Member of the EE Pro Network

Profile
 
 
Posted: 21 February 2007 10:06 AM   [ Ignore ]   [ # 1 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  879
Joined  02-05-2002

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

red face

 Signature 

Member of the EE Pro Network

Profile
 
 
Posted: 22 February 2007 12:37 AM   [ Ignore ]   [ # 2 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  420
Joined  10-10-2004

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.

Profile
 
 
Posted: 22 February 2007 02:51 AM   [ Ignore ]   [ # 3 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  879
Joined  02-05-2002

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 wink

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!

 Signature 

Member of the EE Pro Network

Profile
 
 
Posted: 22 February 2007 10:26 AM   [ Ignore ]   [ # 4 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  420
Joined  10-10-2004

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.

Profile
 
 
Posted: 01 March 2007 06:18 PM   [ Ignore ]   [ # 5 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1505
Joined  05-15-2004

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.

 Signature 


:: Westeros :: Hippoi Athanatoi ::

Blackadder: “Baldrick, have you no idea what irony is?”   
Baldrick: “Yeah! It’s like goldy and bronzy, only it’s made of iron.”
Blackadder III, Amy and Amiability

Profile
 
 
Posted: 05 March 2007 10:29 AM   [ Ignore ]   [ # 6 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  420
Joined  12-26-2005

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}

 Signature 

Noregt, photography and (web)design

Profile
 
 
Posted: 12 March 2007 09:06 AM   [ Ignore ]   [ # 7 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  318
Joined  03-07-2006

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

Image Attachments
re-order.gif
Click thumbnail to see full-size image
 Signature 

· Confused… but happy ·

Profile
 
 
Posted: 12 March 2007 09:28 AM   [ Ignore ]   [ # 8 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  879
Joined  02-05-2002

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? smile

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?

 Signature 

Member of the EE Pro Network

Profile
 
 
Posted: 12 March 2007 09:53 AM   [ Ignore ]   [ # 9 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  318
Joined  03-07-2006

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!!

 Signature 

· Confused… but happy ·

Profile
 
 
Posted: 12 March 2007 11:06 AM   [ Ignore ]   [ # 10 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  879
Joined  02-05-2002

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.

 Signature 

Member of the EE Pro Network

Profile
 
 
Posted: 13 March 2007 02:41 AM   [ Ignore ]   [ # 11 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  318
Joined  03-07-2006

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

 Signature 

· Confused… but happy ·

Profile
 
 
Posted: 18 March 2007 07:55 PM   [ Ignore ]   [ # 12 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  222
Joined  08-07-2005

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.

 Signature 

Anna Brown ~ {MediaGirl} ~ {Portfolio}
Providing web programming services for creative agencies & designers.

Profile
 
 
Posted: 19 March 2007 02:22 AM   [ Ignore ]   [ # 13 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  879
Joined  02-05-2002

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

 Signature 

Member of the EE Pro Network

Profile
 
 
Posted: 19 March 2007 07:13 AM   [ Ignore ]   [ # 14 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  222
Joined  08-07-2005

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

 Signature 

Anna Brown ~ {MediaGirl} ~ {Portfolio}
Providing web programming services for creative agencies & designers.

Profile
 
 
Posted: 21 March 2007 11:54 AM   [ Ignore ]   [ # 15 ]  
Grad Student
Avatar
Rank
Total Posts:  77
Joined  02-22-2004
mediagirl - 18 March 2007 07:55 PM

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.

I actually hacked this into the module last week, if either of you would like to see what I did. It wasn’t that hard, and makes the page much clearer.

Profile
 
 
Posted: 21 March 2007 11:59 AM   [ Ignore ]   [ # 16 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  879
Joined  02-05-2002

Nice, I’d love to see the way you did it smile

 Signature 

Member of the EE Pro Network

Profile
 
 
Posted: 21 March 2007 12:00 PM   [ Ignore ]   [ # 17 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  222
Joined  08-07-2005

Yes please! Would love to know what code you changed.

 Signature 

Anna Brown ~ {MediaGirl} ~ {Portfolio}
Providing web programming services for creative agencies & designers.

Profile
 
 
Posted: 21 March 2007 02:33 PM   [ Ignore ]   [ # 18 ]  
Grad Student
Avatar
Rank
Total Posts:  77
Joined  02-22-2004
Cocoaholic - 21 March 2007 11:59 AM

Nice, I’d love to see the way you did it :)

No problem…

I added this chunk of code:

$r_weblogs = $DB->query("SELECT weblog_id FROM exp_reeorder_prefs WHERE field_id > 0");
$o_weblogs = array();
    if (
$r_weblogs->num_rows > 0) {
        
foreach($r_weblogs->result as $row) { $o_weblogs[] = $row['weblog_id']; }
    }
$assigned_weblogs
= array_intersect($assigned_weblogs, $o_weblogs);

above this line (line 231):

$weblog_query = $DB->query("SELECT weblog_id, blog_name, blog_title FROM exp_weblogs WHERE weblog_id IN ('".implode("','", $assigned_weblogs)."')");


It adds one additional db query, and I’m sure you could combine them into one somehow, but it just wasn’t that important for me to figure out.  :)

Profile
 
 
   
1 of 5
1
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64533 Total Logged-in Users: 35
Total Topics: 81111 Total Anonymous Users: 18
Total Replies: 436427 Total Guests: 207
Total Posts: 517538    
Members ( View Memberlist )