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
15 years ago
Cocoaholic's avatar Cocoaholic

Thank you Lisa!

       
florian's avatar
florian
395 posts
15 years ago
florian's avatar florian

did anybody get the prev/next pagination to work with the reeorder module? I tried the suggested code but I am receiving a SQL error.

Replace: field_id_14, with the field ID of the ordering field you’ve created. Find it in exp_weblog_data

Replace: lesson-order, with the custom field name that you used for the ordering field.

Must be wrapped within exp:weblog:entries.

PREV
{exp:query sql="SELECT url_title AS ut FROM exp_weblog_titles ewt INNER JOIN exp_weblog_data ewd ON ewd.entry_id = ewt.entry_id WHERE ewd.field_id_14 < {lesson-order} AND ewd.weblog_id = {weblog_id} AND STATUS = 'open' ORDER BY field_id_14 DESC LIMIT 1"}    
<a href="/index.php/exampletemplate/{ut}/">PREVIOUS</a>
{/exp:query}

NEXT
{exp:query sql="SELECT url_title AS ut FROM exp_weblog_titles ewt INNER JOIN exp_weblog_data ewd ON ewd.entry_id = ewt.entry_id WHERE ewd.field_id_14 > {lesson-order} AND ewd.weblog_id = {weblog_id} AND STATUS = 'open' ORDER BY field_id_14 ASC LIMIT 1"}
<a href="/index.php/exampletemplate/{ut}/">NEXT</a>
{/exp:query}

Let me know how it goes.
MySQL ERROR:

Error Number: 1064

Description: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '

0002
AND ewd.weblog_id = 2 AND STATUS = 'featured' ORDER BY field_id_46 ' at line 1

Query: SELECT url_title AS ut FROM exp_weblog_titles ewt INNER JOIN exp_weblog_data ewd ON ewd.entry_id = ewt.entry_id WHERE ewd.field_id_46 <

0002
AND ewd.weblog_id = 2 AND STATUS = 'featured' ORDER BY field_id_46 DESC LIMIT 1
       
Cocoaholic's avatar
Cocoaholic
445 posts
15 years ago
Cocoaholic's avatar Cocoaholic

Hi florian,

Just a quick heads-up about the module.

All the module really does is provide an easy way in the CP to add a value to a custom field. Anything beyond that, like the actual ordering or pagination, is 100% weblog tag related.

Sorry I can’t help you out with the sql error, hopefully someone else can!

Cheers, Elwin

       
florian's avatar
florian
395 posts
15 years ago
florian's avatar florian

So can this be done with weblog tags and not query?

My structure looks something like the following:

1.) a sidebar which displays the titles

{exp:weblog:entries weblog="features" orderby="order_features"  dynamic="off" sort="asc" disable="member_data|pagination|trackbacks" status="open|featured|first"}
                                <li><a href="http://{title_permalink=">{title}</a></li>
{/exp:weblog:entries}
2.) the content of an entry in the middle. and 3.) the pagination on the bottom which should show the same order as the title in the sidebar. Right now it displays in different order.
{exp:weblog:entries weblog="features"orderby="order_features"  sort="asc"  disable="member_data|trackbacks" status="open|featured|first"}
                                <h3>{title}</h3>
                                {features_short}
                                {features_full}
{exp:weblog:prev_entry weblog="features" orderby="order_features"   sort="asc"  status="open|featured"}    
                                <a href="http://{path=">previous ‹ {prev_entry->title}</a>
{/exp:weblog:prev_entry}
{exp:weblog:next_entry weblog="features" orderby="order_features"  sort="asc" status="open|featured"}    
                                <a href=”http://{path=">next › {next_entry->title}</a>
{/exp:weblog:next_entry}


                            </div>
{/exp:weblog:entries}
       
paulp's avatar
paulp
38 posts
15 years ago
paulp's avatar paulp

Just installed the REEorder module and it was working great. I just set up a new REEorder field for another weblog and after I selected the custom field in the REEorder preferences all my preferences were deleted. Each time I set my preferences I go back to the REEorder module my preferences are no longer set. Anyone know what might be causing this bug?

Additionally, if I select a custom field in a weblog, select a status, then click “update preferences” the page reloads with other open/closed checkboxes selected for weblogs that I didn’t set.

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

Hi paulp,

I tried but I can’t reproduce the problem. Sounds like there might be something wrong with the database tables.

My advice is to de-install and re-install the module, hopefully that fixes it. Let me know if it helps.

       
paulp's avatar
paulp
38 posts
15 years ago
paulp's avatar paulp

I swear I tried de-installing and re-installing a bunch of times last night but it never fixed the problem… but this morning I tried again and it worked! Must’ve needed coffee.

Thanks for the help and the great module.

       
florian's avatar
florian
395 posts
15 years ago
florian's avatar florian

any ideas for #123? I was just about to delete my previous/next pagination because I cant get it to synch with the way the weblog is ordered through reeorder. I thought I give it another try on the forum to see if anybody was able to do this.

       
Andreas Georgiadis's avatar
Andreas Georgiadis
1 posts
15 years ago
Andreas Georgiadis's avatar Andreas Georgiadis

I installed reeorder on ee 1.6.7 and I have a problem with pagination. Whenever I click on “next page” the list of articles is not updated and the url keeps on adding more /P#/ on top: eg. /index.php/video/P0/P3/P3/P3/

Is this a bug or is it that the reeorder module does not work with pagination?

       
florian's avatar
florian
395 posts
15 years ago
florian's avatar florian
I installed reeorder on ee 1.6.7 and I have a problem with pagination. Whenever I click on “next page” the list of articles is not updated and the url keeps on adding more /P#/ on top: eg. /index.php/video/P0/P3/P3/P3/ Is this a bug or is it that the reeorder module does not work with pagination?

It is not a bug. That’s the way Reeorder works. There is some php code that people use to get the paginatino to work. I did not have any luck with it though. I am still looking for a solution.

You can read one of my earlier posts and the responses here. http://ellislab.com/forums/viewthread/43903/P108/#658406

Let me know if you find a solution as still need it too

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

florian,

I said it before and I’ll say it again: http://ellislab.com/forums/viewthread/43903/P108/#658410

:down:

       
florian's avatar
florian
395 posts
15 years ago
florian's avatar florian

Yes. I know. I was just trying to point Andreas into that direction. That’s why I linked to our previous conversation. I wasnt able to get it working with regular ee order/sort functionality. That’s what I tried after the php code that I found on the forum didnt work and after you had suggested it. I need to revisit this and play around some more. Thanks for your input.

       
dapacreative's avatar
dapacreative
21 posts
15 years ago
dapacreative's avatar dapacreative

Suggestion:

Add a different color to the background when you are dragging and dropping a row. It is a little confusing as is.

       
Brian Litzinger's avatar
Brian Litzinger
693 posts
15 years ago
Brian Litzinger's avatar Brian Litzinger

I’ve always loved this module, but it always had one shortcoming… it didn’t work with Gypsy. If I wanted to reorder 5 weblogs, I had to have 5 ‘ordering’ fields. No longer 😊 I just changed the method below, so now I can create a single ‘order’ field, and it’s available to all weblogs.

function create_custom_field_menu($weblog_id)
    {
        global $DB, $DSP;
        
        // get field_group for this weblog
        $field_group_query = $DB->query("SELECT field_group 
                                        FROM exp_weblogs 
                                        WHERE weblog_id = '$weblog_id'");
        
        $field_group_id = $field_group_query->row['field_group'];
        
        $gypsy_enabled = $DB->query("SELECT count(*) AS count FROM exp_extensions WHERE class = 'Gypsy' AND enabled ='y'");
        
        if($gypsy_enabled->num_rows > 0) 
        {
            // use group_id to get custom field_id, or see if it's a gypsy field
            $custom_field_id_query = $DB->query("SELECT field_id, field_name, field_label, group_id
                                                FROM exp_weblog_fields 
                                                WHERE group_id = '$field_group_id'
                                                OR gypsy_weblogs LIKE '%$weblog_id%' ORDER BY field_order ASC");
        }
        else
        {
            // use group_id to get custom field_id
            $custom_field_id_query = $DB->query("SELECT field_id, field_name, field_label, group_id
                                                FROM exp_weblog_fields 
                                                WHERE group_id = '$field_group_id' ORDER BY field_order ASC");
        } 
        
        $custom_field_id = $DB->query("SELECT * FROM exp_reeorder_prefs WHERE weblog_id = '$weblog_id'");
        if ($custom_field_id->num_rows == 0)
        {
            $cf_id = '';
        } else {
            $cf_id = $custom_field_id->row['field_id'];
        }
        
        $dropdown_menu = $DSP->input_select_option(0, '---');
        foreach ($custom_field_id_query->result as $row) {
            
            if ($row['field_id'] == $cf_id) {
                $dropdown_menu .= $DSP->input_select_option($row['field_id'], '('.$row['field_id'].') ' .$row['field_name'], 'y');
            } else {
                $dropdown_menu .= $DSP->input_select_option($row['field_id'], '('.$row['field_id'].') ' .$row['field_name']);
            }
            
        }
        
        return $dropdown_menu;
    }
       
Interunix's avatar
Interunix
2 posts
15 years ago
Interunix's avatar Interunix

@litzinger: thanks, will test this out now. Definitely worth the fix.

Feature Request: it would be nice to have multiple sorts for a single weblog. Right now only a single field can be tied to the weblog under the REEorder preferences.

       
First 7 8 9 10 11

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.