예제 #1
0
        public ActionResult Logo()
        {
            var logoPictureInfo = _pictureService.Value.GetPictureInfo(Services.StoreContext.CurrentStore.LogoPictureId);
            var hasLogo         = logoPictureInfo != null;

            var model = new ShopHeaderModel
            {
                LogoUploaded = hasLogo,
                LogoUrl      = _pictureService.Value.GetUrl(logoPictureInfo, 0, FallbackPictureType.NoFallback),
                LogoWidth    = logoPictureInfo?.Width ?? 0,
                LogoHeight   = logoPictureInfo?.Height ?? 0,
                LogoTitle    = Services.StoreContext.CurrentStore.Name
            };

            return(PartialView(model));
        }
예제 #2
0
        public ActionResult Logo()
        {
            var store = Services.StoreContext.CurrentStore;
            var logo  = _mediaService.Value.GetFileById(store.LogoMediaFileId, MediaLoadFlags.AsNoTracking);

            var model = new ShopHeaderModel
            {
                LogoUploaded = logo != null,
                LogoTitle    = store.Name
            };

            if (logo != null)
            {
                model.LogoUrl    = _mediaService.Value.GetUrl(logo, 0, null, false);
                model.LogoWidth  = logo.Dimensions.Width;
                model.LogoHeight = logo.Dimensions.Height;
            }

            return(PartialView(model));
        }