The problem: The Course Image is cropped to fit the course header on the workspace page, so wide banner artwork gets cut off or distorted.

What we did: We added one optional Image attribute to Learning Course. When a course has a banner, the course page shows the attribute banner image and kicks down the overlay element. When it doesn't, the page behaves exactly as it did before.

See screenshots 1–2 for before and after.

Step 1: Add the Entity Attribute

Go to Settings > System > Entity Attributes and add an attribute with these settings (screenshot 3):

SettingValue
Entity TypeLearning Course
Name / Abbreviated NameBanner Image
KeyBannerImage (the Lava below depends on this exact key)
Field TypeImage
File TypeUnsecured
DescriptionOptional image file to replace the Course Image File Guid property on the Course Details page/block.
Required, Show in Grid, PublicOff

Then open a course and upload a banner in the new Banner Image field, under the regular course Image (screenshot 5). Courses without a banner keep their current image.

Step 2: Update the Lava Header Template

Edit the Public Learning Class Workspace block settings and replace the Lava Header Template with the following (screenshot 4). Back up the existing template first.

<style>
    .hero-section.hero-section-banner {
        height: auto;
    }

    .hero-section-banner .hero-section-image {
        margin-bottom: 0;
    }

    .hero-section-banner .hero-section-content {
        position: relative;
        left: auto;
        bottom: auto;
        transform: none;
        margin: -3.5rem auto 0 auto;
    }

    @media (max-width: 767px) {
        .hero-section-banner .hero-section-content {
            width: 92%;
        }
    }
</style>

{% assign bannerGuid = Course | Attribute:'BannerImage','RawValue',false %}
{% assign hasBanner = false %}

{% if bannerGuid and bannerGuid != empty %}
    {% assign hasBanner = true %}
{% endif %}

{% if hasBanner %}
    {% assign heroImageUrl = '/GetImage.ashx?guid=' | Append:bannerGuid %}
{% else %}
    {% assign heroImageUrl = '/GetImage.ashx?guid=' | Append:Course.ImageBinaryFile.Guid %}
{% endif %}

<div class="hero-section{% if hasBanner %} hero-section-banner{% endif %} mb-5">
    <div class="hero-section-image" style="background-image: url('{{ heroImageUrl }}')"></div>
    <div class="hero-section-content">
        <h1 class="hero-section-title"> {{ Course.PublicName }} </h1>
        <p class="hero-section-description"> {{ Course.Summary }} </p>
    </div>
</div>

How it works

  • The Lava reads the BannerImage attribute. If it has a value, the page adds the hero-section-banner class and uses the banner. If not, it falls back to the Course Image.
  • The CSS applies only when a banner exists. It lets the image show at its natural height and overlaps the course title card onto the bottom of the banner.
  • Only the Lava Header Template changed. No code or database changes are required.