Quantcast
Channel: ActiveTopics
Viewing all articles
Browse latest Browse all 72689

Get image url from content

$
0
0

I noticed in the umbraco 8 standard template installation the following code:

@using Umbraco.Core.PropertyEditors
@inherits UmbracoViewPage
@{
    Layout = null;
    // Get basic design settings from the homepage
    var home = (Home)Model.Root();
    var font = home.Font;
    var colorTheme = home.ColorTheme;
}

and then this:

                <div class="nav-link--home">
                    <img class="logo-image" src="@home.SiteLogo.Url" alt="@home.Sitename">
                </div>
            }

Can someone explain this line for me:

var home = (Home)Model.Root();

Because in my own solution when I try the following:

@inherits Umbraco.Web.Mvc.UmbracoViewPage
@{
Layout = null;
var forside = (Forside)Model.Root();
  }

and then

  <img class="logo-image" src="@forside.Logo.Url" >

I get a compliation error that The type or namespace name 'Forside' could not be found.


Viewing all articles
Browse latest Browse all 72689

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>