Forum

Please make sure that you have read the documentation and extensive resources provided on this site before posting your question!

Dynamic Content Gallery Resources

DCG Version 4.0 beta is now available for download and testing. This is a development version and not recommended for live sites. Read more here.

Note that the current stable release of the DCG is version 3.3.5.

Please consider registering
guest

Log In Register

Register | Lost password?
Advanced Search:

— Forum Scope —



— Match —



— Forum Options —




Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 3 characters - maximum search word length is 84 characters

Topic RSS
DCG 3.3.5 Bug Report - Slide Ordering
Status: fixed
January 25, 2012
8:36 pm
tim
New Member
Forum Posts: 1
Member Since:
January 25, 2012
Offline

I have found what seems to be a bug in DCG 3.3.5 on Wordpress 3.2.1. We found that on our site, we were unable to properly order the slides using the "Order" input box in the "Attributes" metabox on the slides, and in fact it seemed to be ignoring this field entirely.

After doing some investigation in the database I found that the "menu_order" field in the "wp_posts" table was being updated properly by changing the Order value, but the plugin still wasn't ordering properly by that field. After doing some more digging through the plugin, I realized that in the $query string built on line 421 of dfcg-gallery-constructors-jq-smooth.php (We're using the custom-post method with jquery) there is no argument to order the posts at all.

So, I changed line 421 from:

$query = 'post_type=' . $post_type . '&' . $term_selected . '&showposts=' . $posts_number;

To:

$query = 'post_type=' . $post_type . '&' . $term_selected . '&showposts=' . $posts_number . "&orderby=menu_order";

And this appears to make the slide ordering work as expected, responding to the Order field input on the slide.

I only fixed this singular line of code in my copy of the plugin since it was all we needed to make our site work, but it appears that all the other query types also do not sort properly for the same reason. I'm not quite sure why this ordering code was left out in the plugin up until now, but it is probably something that should be fixed, please let me know if I am mistaken.

Tim Zook ~ tim@umstattdmedia.com

February 8, 2012
7:25 am
Ade
Admin
Forum Posts: 2490
Member Since:
August 25, 2008
Offline

Hi Tim,

Thanks for your detailed post – and investigations.

Actually, slide ordering is only designed to be a feature of the ID gallery method. So, if you look in the same file, you should see that the SQL query uses the _dfcg_sort meta_key (around line 745 in the same file).

However, your post has prompted me to consider adding this capability to the 'One Category' gallery method.

Dynamic Content Gallery: Have you read the Configuration Guide and FAQ?
Forum Timezone: UTC 1

Most Users Ever Online: 28

Currently Online: nloronacele
14 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

johnbroome: 13

sjpeaches: 12

speedyp: 12

CherylMcL: 10

littlemerry: 8

lsnoei: 8

Member Stats:

Guest Posters: 770

Members: 1297

Moderators: 0

Admins: 1

Forum Stats:

Groups: 2

Forums: 7

Topics: 978

Posts: 4293

Newest Members: chargers3, jwhetstone, robert, Mak-Donuts, kilerb, Marian Bamboi

Moderators:

Administrators: Ade (2490)