示例#1
0
    public ActionResult Index()
    {
        IUmbracoContext        umbracoContext = _umbracoContextAccessor.GetRequiredUmbracoContext();
        IPublishedContentCache?store          = umbracoContext.Content;

        if (store?.HasContent() ?? false)
        {
            // If there is actually content, go to the root.
            return(Redirect("~/"));
        }

        var model = new NoNodesViewModel {
            UmbracoPath = _hostingEnvironment.ToAbsolute(_globalSettings.UmbracoPath)
        };

        return(View(_globalSettings.NoNodesViewPath, model));
    }
        public ActionResult Index()
        {
            var umbracoContext = _umbracoContextAccessor.GetRequiredUmbracoContext();
            var store          = umbracoContext.Content;

            if (store.HasContent())
            {
                // If there is actually content, go to the root.
                return(Redirect("~/"));
            }

            var model = new NoNodesViewModel
            {
                UmbracoPath = _ioHelper.ResolveUrl(_globalSettings.Value.UmbracoPath),
            };

            return(View(_globalSettings.Value.NoNodesViewPath, model));
        }