You can add a 'banner,' 'header' or 'hero' image to your Drupal Lite site by creating a Custom Text Block in the Featured region.
Table of Contents
- Requirements
- Creating A Custom Block
- Configuring the Custom Block
- Specifying Pages where Header Appears
Requirements
Advanced Site Builder Role
Before you can create this Custom Block, you need to have the Advanced Site Builder role on the Drupal site. OIT does not assign this role by default.
- If you do not, but you do have the Access Manager role, you can assign yourself the Advanced Site Builder role.
- To assign the role yourself:
- Go to People in the Drupal Admin bar
- Find your user name, and click Edit
- Under Assignable roles, check the Advanced Site Builder option
- Click Save at the bottom
- If you do not have the Access Manager role, someone with that role will need to assign you these permissions.
Pre-Configured Image
Drupal Lite 9 does not have a way to crop or adjust an image. The image must be pre-configured to the right size before you upload it to the site.
For a guide on how to Crop and Resize Images for Use
- Image should be at least 1200 pixels in width
- Height is up to your discretion
Creating A Custom Block
Once you have your image cropped and you have the Advanced Site Builder role then you can create a Custom Block.
- Go to Structure, then Block Layout, and then Add Custom block in the admin menu
- Select Text as the Block type
- Fill in the required Block description field
- For easy reference, label it "Header Image" or something to that effect
- In the Body section, Upload your image
- In the toolbar, select Media Library button
- In the Image Menu, under Add File, click Browse
- Find and select your image
- Give the Media a recognizable name(i.e. Header Image Source)
- Create Alternative text
- Click Save and configure
- In the toolbar, select Media Library button
- Click Save. The Configure Block page automatically opens
Configuring the Custom Block
- Uncheck Display title check box
- Set your Visibility requirements, if any
- In the Region drop-down, select Featured
- Click the Save block at the bottom
Editing the Custom Block or the Header Image
Sometimes you may wish to change the Custom Block configurations, or edit the Header Image.
- Edit Custom Block configurations
- Navigate to the Header Image Block Configuration
- Select Structure then Block layout
- Find your Header Image Block under Featured
- Click Configure
- Edit the Header Image
- Changes to the image sizing of color cannot be done in Drupal Lite 9.
- You will have to manually change the original image on your computer.
- Navigate back to your Header Image block
- Click Structure, then Block layout, then Custom Block library, and find your Header Image
- Click Edit
- In the Body field, select and Delete the image currently in the Block
- Upload the new one
Specifying Pages where Header Appears
By default, your Header will appear on all pages.
You can restrict the Header image to only appear on select Pages or Content Types if desired.
Appear on Certain Content Types (i.e., Biography pages)
- Under Visibility select the Content types menu (4th option on the list)
- Select which Content Types you want to show the Header
Appear on Certain Pages
- Under Visibility select the Pages menu
- Select Show for the listed pages (if it isn't already)
- Enter the pages you want to display the Header
- <front> is for just the Homepage
- * is a wildcard
In this example, the Header Image block would only appear on the Home Page, and every User page.
Hide on Certain Pages
- Under Visibility select the Pages menu
- Select Hide for the listed pages
- Enter the pages you want to exclude the Header
- Ex: <front>
- This will make the Header appear everywhere except the Homepage
- Ex: <front>