Even though I'm now using Drupal 6, and this was created for Drupal 4.7, this is the ONLY post that helped me create a random post in a block, albeit 3 hours later but still.. I need to keep this somewhere :)
1. create a new view in administer » views » add tab.
2. give it a name. I called mine "Random".
3. click the "Block" section heading to get its settings.
4. enable "Provide block"
5. choose a "View type". I went with "List View" so that I could choose which fields display in the block.
6. type in a title. This will be the title of the block. In this example I used "Random" as well.
7. type in a number for the amount of nodes you want to display in the block. You can use 1 (number one) if you like.
8. click the "Fields" section heading to get its settings.
9. add the fields you want. I chose just "Node: Title" since I wanted just links to the blog posts, not the text.
10. click the "Filters" section heading to get its settings.
11. select "Node: Type" and click "Add Filter"
12. choose the content type(s) you want to appear in the block. In this example, I chose the 'blog' type.
13. select "Node: Published" and click "Add Filter". (I keep forgetting this one, but it's important, since you probably don't want to display unpublished nodes.
14. click the "Sort criteria" section heading to get its settings.
15. select "Random" and click "Add criteria".
16. click "Save"
17. click administer » blocks and enable the block you titled in step #6.
Thursday, June 5
Link to a Random Blog Post in a Sidebar Block
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment