We have created a relatively simply view that takes as its third argument a series of node IDs separated by one of the suggested delimiters ("," or "+"). Everything seems to work fine in that the view returns the requested fields for each of the node IDs included in the argument. However, we have noticed that the order of the node IDs is not necessarily honored. For instance:

print views_embed_view('Slideshow', 'block', 1,2,3,4,5);

The above call returns all requested fields for each node ID, however they are not returned in order; they might be returned as 1,2,5,4,3.

Has anyone else encountered this issue; or has anyone got any pointers as to where we might have gone wrong?

Thanks.

Comments

dawehner’s picture

Do you have enabled any sort criteria? This would cause the nids to be returned in another order

reinholdlange’s picture

dereine - Thank you for replying. I have no sort criteria defined.

merlinofchaos’s picture

Status: Active » Closed (won't fix)

All sorting is done by database order, not by the order you enter the arguments. This has been discussed extensively in the past.

reinholdlange’s picture

merlinofchaos - understood - thank you for taking the time to reply.

merlinofchaos’s picture

FYI: The nodequeue module is excellent for sorting nodes in arbitrary order (and provides a nice UI for setting it up so you don't need to code a group of nids).