Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Brygger92 9 posts 79 karma points
    Jan 24, 2023 @ 13:52
    Brygger92
    0

    problems with a to big top banner

    want to reduce the size of the top banner but is a litlle in doubt where it is best to implement it.

    i asume it is in the file called Topbanner.cshtml

    @inherits Umbraco.Web.Mvc.UmbracoViewPage

    @if (Model.TopBannerMedia.HasValue()) { @BannerContent() if (Model.IsVideo) {

        <div class="top-banner__image">
            <video-background path="@Model.TopBannerMedia.MediaItem.Url()" />
        </div>
    }
    else
    {
        <background-image class="top-banner__image desktop" :lazyload="false" src="@Model.TopBannerMedia.MediaItem.GetCropUrl("hero-banner-desktop")">
        </background-image>
        <background-image class="top-banner__image mobile" :lazyload="false" src="@Model.TopBannerMedia.MediaItem.GetCropUrl("hero-banner-mobile")">
        </background-image>
    }
    

    } else { @BannerContent() }

    @helper BannerContent() { bool hasHeadline = Model.TopBannerHeadline.HasValue(); bool hasText = Model.TopBannerText.HasValue(); if (hasHeadline || hasText) {

    @if (hasHeadline) {

    @Model.TopBannerHeadline

    } @if (hasText) {
    @Model.TopBannerText
    }

                    @if (Model.TopBannerLinks.HasValue())
                    {
                        <div class="top-banner__links">
                            @foreach (var link in Model.TopBannerLinks)
                            {
                                <a class="btn btn--outlined btn--white" href="@link.Url" target="@link.Target">@link.Name</a>
                            }
                        </div>
                    }
                </article>
            </div>
        </div>
    }
    

    }

  • Nik 1593 posts 7151 karma points MVP 6x c-trib
    Jan 31, 2023 @ 22:51
    Nik
    0

    Hi Brygger92,

    Did you manage to solve your issue in the end?

    Nik

Please Sign in or register to post replies

Write your reply to:

Draft