Copied to clipboard

Flag this post as spam?

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


  • Shaishav Karnani from digitallymedia.com 354 posts 1638 karma points
    Dec 19, 2014 @ 08:35
    Shaishav Karnani from digitallymedia.com
    0

    Need to get most website properties in the master page.

    Couple of questions related to it.

    1. I thought to add Website Model in the IMasterModel. Is it correct way? (code snippet below)  

    2. Also on Master page I am not getting any Model.Content or CurrentPage. How can we get it?

        public interface IMasterModel    {
            IEnumerable<MenuItem> MenuItems { get; set; }
            string SeoTitle { get; set; }
            string SeoDescription { get; set; }
            Website website { get; set; }
       }

    Thanks!

    Awesome Package!

     

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Jan 12, 2015 @ 12:10
    Jeroen Breuer
    0

    Hello,

    This has changed between v6 and v7. In the version for v6 you could use Model.Content, but in v7 you don't have that. If you want to have some website properties on the masterpage you need to add them manually. 

    This example shows how to add the Twitter link: https://github.com/jbreuer/Hybrid-Framework-for-Umbraco-v7-Best-Practises/blob/master/Umbraco.Extensions/BLL/ModelLogic.cs#L31

    Jeroen

Please Sign in or register to post replies

Write your reply to:

Draft