Now, with the devel_generate
module enabled, we are going to generate some Recipe content so that we can test the number of items in our Recipe List block:
First, click on the Configuration link in the admin toolbar, and then click on the Generate content link under the Development section.
On the Generate content page, uncheck all the Content type checkboxes except the one for Recipe.
Stick with the default values for all the rest of the settings, and click on the Generate button at the bottom of the page.
Now, navigate to the home page and you will see the Recipe List block fully populated.
Although this is a very simple example of using the devel_generate
module, being able to generate content can be a big time saver when testing custom code that requires multiple content items. We just used the devel_generate
module to generate some dummy content, based on our custom Recipe content type, and now...