Copied to clipboard

Flag this post as spam?

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


  • Brygger92 5 posts 75 karma points
    7 days ago
    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>
    }
    

    }

Please Sign in or register to post replies

Write your reply to:

Draft