Client editable Header Banner Block

Permalink
I am completely new to Concrete5 But I have the basic block development down (allowing users to edit blocks in edit mode). C5 seems to be the easiest CMS for clients so I have been doing research on the development end for it. I don't want to switch just cause of this issue.

Where I am stuck at is HOW do I make it so that clients can change a header banner to their selected image. My theme header image takes up 100vh with texts in the center of the image.

Where I'm stuck:
What code do I need to let clients choose an image that will replace my default image header. I attached a file of my header image below that I would like clients to be able to replace.

HTML:
<header id="header_bg">
<span class="header_content">
<h1 class="header_title"> <? $a = new Area('Main Title');
$a->display($c); ?> </h1>
<p class="header_kicker"> <? $a = new Area('Main Kicker');
$a->display($c); ?> </p>
</span>
</header>

CSS:
#header_bg {
background: url(img/header_photo.jpg) no-repeat center center;
background-size: cover;
-o-background-size: cover;
-moz-background-size: cover;
-webkitz-background-size: cover;
height: 100vh;
width: 100%;
display: inline-block;
}

1 Attachment

 
MrKDilkington replied on at Permalink Reply
MrKDilkington
Hi ramdettmer,

There are multiple approaches that you could take. Here are a few to get started with.

One is to use an Image/File page attribute. This attribute would be applied to the page with the header image that you wanted to be user customizable. In your theme files (page template or include), you would read the value of the attribute (a link to an image), then use that image link value in your CSS.

Another option is to use the theme style customization. Theme style customization allows users to control theme styling through the Customize Theme panel.

The following is a link to its documentation:
https://documentation.concrete5.org/developers/designing-for-concret...