Hi all,
I've come across one more issue with the Content Glider that I need help with. It seems (unless I am misunderstanding the problem) that when the glider outputs the nodes in ascending or descending order, that it is going by node number (which is usually the order in which the node is created), instead of first letter of the title, or something like that. Unfortunately, if the nodes were created in a random order and NOT in the order in which you want them displayed, this is a problem. I can't figure out how to get around this, and it seems that changing the node number is not a good option. Any help or advice is greatly appreciated. Thanks very much,
Lynne

Comments

gjd’s picture

I have a couple more manual solutions that might help until you get a better solution.. I'm actually looking forward to a better solution for the same thing, as posted here earlier: http://drupal.org/node/810988

One option is you can arrange it by the page title. This is the original code in content_glider.module

	  $sql = " SELECT n.nid, n.title, r.teaser "
		      ." FROM {node} n INNER JOIN {node_revisions} r ON n.nid=r.nid "
	        ." WHERE n.status=1 AND n.type IN ($content_type_str) "
					." ORDER BY n.created %s LIMIT %d";

and this is what you want to replace it to order them by the title:

	  $sql = " SELECT n.nid, n.title, r.teaser "
		      ." FROM {node} n INNER JOIN {node_revisions} r ON n.nid=r.nid "
	        ." WHERE n.status=1 AND n.type IN ($content_type_str) "
					." ORDER BY n.title %s LIMIT %d";

You don't have much control over it this way though..

You can have more control if you cheat a bit and order them by the time they were created.. Then you get to edit their authoring time manually and set their order by that.. Remember to fix the authoring time every time you edit that page...
Here is the code you need to do that:

	  $sql = " SELECT n.nid, n.title, r.teaser "
		      ." FROM {node} n INNER JOIN {node_revisions} r ON n.nid=r.nid "
	        ." WHERE n.status=1 AND n.type IN ($content_type_str) "
					." ORDER BY r.timestamp %s LIMIT %d";

It would be great if I could create a new taxonomy term and order the slides by that.. I couldn't figure out how to place it here
" ORDER BY (theNewTaxonomyTerm) %s LIMIT %d"

Someone that know PHP could help with that :)

lfrey’s picture

Hi Jane - hey, thanks again for the help! guess what - I was able to change the node order by editing the authoring information field on the node form, without having to alter the code in content_glider.module. I didn't go there originally because once I saw that the glider nodes were displaying in node order, I thought that was it. Thanks for the heads up!
Lynne

gjd’s picture

Glad to hear that it helped! I guess n.created and r.timestamp are the same thing then..

I still wish there was a better way to do it, preferably from the admin > settings > content_glider page.. Or if it could be sorted by the weight on the menu..

Jane