[development] Drupal 7 Entities - view random node

Larry Garfield larry at garfieldtech.com
Mon Jan 24 00:41:34 UTC 2011


I did that all the time in Drupal 6 using Views.  It's dead simple.  (Order 
random limit 1, done.)  I haven't tried doing it in Drupal 7, but I'm sure the 
same method still works.

--Larry Garfield

On Sunday, January 23, 2011 1:33:34 pm Blaine Lang wrote:
> I have a need for a block that will display a random quote. Node type =
> 'random_quote' and only 1 random record should be displayed
> 
> In D7 the body contents are in field_data_body and I have it working
> using the DB API but it would probably be better using the
> entityController class methods like 'entity_load'
> 
> I see that you can pass in conditions but is it possible to return a
> single random record?
> 
> Does anyone with more experience with the new EntityController have any
> recommendations?
> 
> Thanks!


More information about the development mailing list