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
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
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}
{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}
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.
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?
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
florian,
I said it before and I’ll say it again: http://ellislab.com/forums/viewthread/43903/P108/#658410
:down:
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.
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;
}
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.