Getting Started:
- From the left sidebar navigation choose the ‘Administer' link.
- From the Administer page choose ‘Content Types' from under the ‘Content Management' section.
- From the ‘Content Types' page click the ‘Add content type' button from within the top tabs.
Identification:
- For the ‘Name' we want something user friendly so any potential user can figure out what the content type is for easily. Let's go ahead and give it the value Random Image.
- For the ‘Type' we need to input a machine readable name that will be used in constructing the URL for the ‘create content page'. We'll want this to be something easily recognizable as well so let's go ahead and give it the value random_image. Note: Since the value needs to be machine readable only lowercase letters, numbers, and underscores are allowed, hence why the value we gave here is all lower case and has an underscore rather than a space within it.
- The description is mainly a helper for any users looking to create content. It gives a quick overview of what the content type is and its basic purpose. For the description go ahead and put in something that will let the user know the content type is for images to be used in the random image block.
Submission Form:
- The ‘Title field label' is the label that will appear next to the title field when a user creates a piece of content with this content type. The default value for this is just fine so we won't change it.
- The ‘Body field label' is the label that will appear next to the main content input area. We want to have a body content area so we will want to make sure this field has a value. However, the default value body is a bit general so we will give it a value that is more specific to our uses. Give it a value of Image Description.
- There is no need to set the minimum number of words for the entry seeing as we don't want to force the description of the image to be a certain length.
- In this instance we are also going to leave ‘Explanation or submission guidelines' blank since the content type won't be very complex and the labels should be simple enough for users to get through.
Workflow:
- Under default options you will need to uncheck the ‘Promoted to front page' option. Un-checking this option prevents Drupal from just putting all the images you create onto the front page.
- Now select ‘Save content type'.
Adding the image field:
- After saving the content type you should have been taken back to the ‘Content Types' page. From here find your new content type and press the edit link for your content type.

- You should now see a page virtually identical to the original content type creation page.
- From the top of this page click the tab that says ‘Add Field'. We're now going to add the field for the image to be uploaded.

- First thing you will need to give the field a machine readable name, so again only lowercase letters, numbers, or underscores. We'll keep the name self-explanatory by giving it a value of image.
- Below the title is the ‘Field Types’ options. As you can see there are many types of fields that you can add to your content type allowing for numerous possibilities. For this application however, we just want to add a simple image field. So scroll down the lists of field types until you see image and select it. Now Press ‘Create field’.
- You will now be directed to a new page which will confirm the creation of the field near the top and now give you a few more options for the field.
- You can leave the ‘Widget' field alone as it is already set to image.
- The ‘Label' is the label that will appear next to our newly created field. Drupal automatically fills in this value with the value of the machine readable name from the last page. However for appearance sake let us go ahead and change the label to include capital letters. So change the value from image to Image.
- ‘Maximum resolution for Images' will define what the maximum resolution the images can be. If an image is larger than the maximum resolution than Drupal will scale the image to fit within the defined resolution. Go ahead and set the resolution to 640x480. Note: It's best to resize your images to the correct size prior to uploading the image to avoid any distortion from the scaling.
- You can go ahead and skip the ‘Image Path' option since there is no need to specify a certain place for just these images to be saved. The default file location will do just fine for our goal.
- Next check both the ‘Enable custom alternate text’ and ‘Enable custom title text’ options this allows you to input your own text for the title of the image and the alternative text to be shown in the event a user has images turned off. If these two options are not checked Drupal will just use the file name of the image for both.
- You can go ahead and skip ‘Display in group’. Since this image field is the only custom field we will be creating there is nothing else to group it with, and also no groups created so we will leave it on the default. ‘Help text’ can also be skipped as we mentioned before since the content type isn’t all that complex the labels should be just fine for explaining everything.
- Under the data settings header we will want to select the required option. This makes the image field a required field that must be filled out in order for the content to be submitted. We want this field required because without the image the content wouldn't be much use for the random image block.
- Now press ‘Save field settings’.
Verifying the Content Type:
- Your custom content type should be created now. We will just verify it real quick before moving on.
- Choose ‘Create Content' from the left sidebar navigation.
- In the ‘Create Content' page you should see a list of content types. Your new content type should be within this list.
- Choose your newly created content type. Now verify that there is a title field, an image field for uploading a photo, and an ‘Image Description' field. If so the content type is ready to go and we will pick up from here in the next part.
Go to:
Random Image Block Part 2: Adding Content
Random Image Block Part 3: Creating the View