Score:0

Drupal 9 - Modules for background Video or Image

it flag

I'm yet another newbies excited about Drupal.

For my sample site, I used the Adaptive Theme (no particular criteria for me selecting this theme). I just wanted to check is there a quicker way to add background image or video for the home page of the site?

The modules like "background_image" and "background_video" seems to have not being maintained actively.

I tried following in "Custom CSS" section of the Adaptive Theme.

/*
.dialog-off-canvas-main-canvas {
  background-image: url("https://www.w3schools.com/w3images/photographer.jpg");
  background-color: #cccccc;
  height: 500px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
}
*/

body #header { 
  background-color: #FFFFFF !important;
  background-image: url("https://www.w3schools.com/w3images/photographer.jpg") !important;
  background-repeat: no-repeat !important;
  background-attachment: scroll !important;
  background-position: left top !important;
  background-size: cover !important;
  -webkit-background-size: cover !important;
  -moz-background-size: cover !important;
  -o-background-size: cover !important;
}

Many thanks.

misterdidi avatar
de flag
Hi, I don't know about video background but for images you have quite a recent module here: https://www.drupal.org/project/bg_image_formatter. If you don't find what you are looking for, you may also end developing your own custom FieldFormatter to suit your needs.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.