Recipe 23: Creating a Default View
Note
Ingredients
Completed Recipes 4 and 6
In this recipe we will create a module to implement a default view. At the core of this recipe is a Views hook called hook_views
_default_views()
. This should be a fairly accessible recipe, even if you don't consider yourself to be an accomplished coder. The module will have three files.
swim_groups.info
swim_group.views_default.inc
swim_groups.module
If it isn't there already, create a new directory under
<DRUPALROOT>/sites/default/modules/
called custom (of course, if themodules
directory doesn't yet exist, make sure to create that first).Create a directory under
<DRUPALROOT>/sites/default/modules/custom
calledswim_groups.
The ".info" file
Create a file in
<DRUPALROOT>/sites/default/modules/custom/swim_groups
, namedswim_groups.info
, containing the following content:; $Id$ name = Swim Groups description = Module demonstrating a default view dependencies = views package = Other