Check your version
This tutorial covers a topic in Drupal 7 which may or may not be the version you're using. We're keeping this tutorial online as a courtesy to users of Drupal 7, but we consider it archived.
Create a custom block with details from the database containing information about user preferences.
Goal
Create a custom block that displays a random entry from the user's movie preferences.
Prerequisites
You will need the following knowledge and skills. If you need a review, check out the Additional resources section at the bottom of this page.
- Define a custom block.
- Display and position a custom block.
Tasks
Define a custom block which retrieves a random entry from the user's movie preferences table created earlier.
Recap
- Blocks can be created programmatically.
- There are many rules to govern the visibility of blocks.
Further your understanding
Additional resources
- API Documentation: Block hooks (api.drupal.org)