MetaData 2

        @inherits UmbracoViewPage
        @{
            var home = Model.AncestorOrSelf<Home>()!;
            var siteSettings = home.FirstChild<SiteSettings>()!;
            var favicon = siteSettings.Value<MediaWithCrops>("favicon")!;
            var title = string.IsNullOrEmpty(Model.Value<string>("metaTitle"))
                ? Model.Name
                : Model.Value<string>("metaTitle");
            var indexable = Model.Value<bool>("isIndexable") ? "index" : "noindex";
            var followable= Model.Value<bool>("isFollowable") ? "follow" : "nofollow";
            var robots = $"{indexable}, {followable}";
        }
        
        <title>@title - @siteSettings.SiteName</title>
        <meta name="description" content="@Model.Value("metaDescription")">
        <meta name="robots" content="@robots" />
        <link href="@favicon.MediaUrl()" rel="icon">
        

Forrige Næste