Closed (fixed)
Project:
Nodequeue
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
2 Dec 2007 at 17:10 UTC
Updated:
16 Jul 2012 at 00:28 UTC
Jump to comment: Most recent
I've created a custom block for nodequeue using the views module. I would like to fetch a random node to display in this block. I've read the documentation in the nodequeue README.txt file that describes how to fetch a random node in a custom block. It is not clear to me how you would achieve this same effect using the views module. Is this something you can help with?
Comments
Comment #1
merlinofchaos commentedAll you need to do is apply the 'Sort: Random' sort, and set the nodes per page to 1. Be sure you have the proper filter for the nodequeue.
Comment #2
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #3
khazar commentedThe View Module, at least 6.x-2.0-rc1, does not appear to offer a "Random" option in the Sort Criteria area. Just "asc" and "dsc". Is there something I'm missing?
Comment #4
blockedmind commentedyea, random is missing
Comment #5
ezra-g commentedThanks for pointing this out: The random sort order was not included in the update to Drupal 6. This is a valuable feature and should be included!
Comment #6
ezra-g commentedComment #7
merlinofchaos commentedIt's there.
Comment #8
ezra-g commentedIt's in the "Global" group ;).
Comment #9
blockedmind commentedit does not select in random order. it helps displaying in random order only. that's not the same.
Comment #10
blockedmind commented?
Comment #11
mgladding commentedI too am a bit confused. I want to be able to randomly display a client quote in a block and I assumed this module would allow that. Many references to this node mention a "Sort:Random" option in Views.
What is the current standard for displaying random nodes via Nodequeue?
Comment #12
ezra-g commentedThe random sort order is part of the Views "Global" group and in my testing, with random as the only sort criteria, the nodes display in a random order upon refreshing.
Comment #13
missiria commentedThanks I need its too ;)
Comment #14
gmarcotte commentedglobal random does not work. adding this causes the filter node type to be ignored. on the preview I am getting nodes that are not the type I filtered for. the sql looks so I ave no idea how I could possible get this result.
some one above said something about nodequeue? this is drupal 6
SELECT node.nid AS nid,
node_data_field_rotateimage.field_rotateimage_fid AS node_data_field_rotateimage_field_rotateimage_fid,
node_data_field_rotateimage.field_rotateimage_list AS node_data_field_rotateimage_field_rotateimage_list,
node_data_field_rotateimage.field_rotateimage_data AS node_data_field_rotateimage_field_rotateimage_data,
node.type AS node_type,
node.vid AS node_vid,
node_revisions.teaser AS node_revisions_teaser,
node_revisions.format AS node_revisions_format,
RAND() AS _random
FROM node node
LEFT JOIN content_type_featurepage_rotate node_data_field_rotateimage ON node.vid = node_data_field_rotateimage.vid
LEFT JOIN node_revisions node_revisions ON node.vid = node_revisions.vid
WHERE (node.status = 1) AND (node.type in ('featurepage_rotate'))
ORDER BY _random ASC