Exemplo n.º 1
0
        public string Render(MerchantTribe.Commerce.MerchantTribeApplication app, dynamic viewBag, MerchantTribe.Commerce.Content.ContentBlock block)
        {
            FeaturedProductsViewModel model = new FeaturedProductsViewModel();

            model.Items = PrepProducts(app.CatalogServices.Products.FindFeatured(1, 100), app);
            return(RenderModel(model, app));
        }
        public string Render(MerchantTribe.Commerce.MerchantTribeApplication app, dynamic viewBag, MerchantTribe.Commerce.Content.ContentBlock block)
        {
            RssFeedViewModel model = new RssFeedViewModel();

            model.Channel = new RSSChannel(new MerchantTribe.Commerce.EventLog());

            if (block != null)
            {
                string feedUrl = block.BaseSettings.GetSettingOrEmpty("FeedUrl");
                model.Channel.LoadFromFeed(feedUrl);
                model.ShowTitle       = block.BaseSettings.GetBoolSetting("ShowTitle");
                model.ShowDescription = block.BaseSettings.GetBoolSetting("ShowDescription");
                int max = block.BaseSettings.GetIntegerSetting("MaxItems");
                if (max <= 0)
                {
                    max = 5;
                }
                model.MaxItems = max;
            }

            return(RenderModel(model));
        }
Exemplo n.º 3
0
        public string Render(MerchantTribe.Commerce.MerchantTribeApplication app, dynamic viewBag, MerchantTribe.Commerce.Content.ContentBlock block)
        {
            ImageRotatorViewModel model = new ImageRotatorViewModel();

            if (block != null)
            {
                var imageList = block.Lists.FindList("Images");
                foreach (var listItem in imageList)
                {
                    ImageRotatorImageViewModel img = new ImageRotatorImageViewModel();
                    img.ImageUrl = ResolveUrl(listItem.Setting1, app);
                    img.Url      = listItem.Setting2;
                    if (img.Url.StartsWith("~"))
                    {
                        img.Url = app.CurrentRequestContext.UrlHelper.Content(img.Url);
                    }
                    img.NewWindow = (listItem.Setting3 == "1");
                    img.Caption   = listItem.Setting4;
                    model.Images.Add(img);
                }
                string cleanId = MerchantTribe.Web.Text.ForceAlphaNumericOnly(block.Bvin);
                model.CssId    = "rotator" + cleanId;
                model.CssClass = block.BaseSettings.GetSettingOrEmpty("cssclass");

                model.Height = block.BaseSettings.GetIntegerSetting("Height");
                model.Width  = block.BaseSettings.GetIntegerSetting("Width");

                if (block.BaseSettings.GetBoolSetting("ShowInOrder") == false)
                {
                    RandomizeList(model.Images);
                }
            }

            return(RenderModel(model));
        }
Exemplo n.º 4
0
        public string Render(MerchantTribe.Commerce.MerchantTribeApplication app, dynamic viewBag, MerchantTribe.Commerce.Content.ContentBlock block)
        {
            BannerAdViewModel model = new BannerAdViewModel();

            if (block != null)
            {
                model.ImageUrl = block.BaseSettings.GetSettingOrEmpty("imageurl");
                model.AltText  = block.BaseSettings.GetSettingOrEmpty("alttext");
                model.CssId    = block.BaseSettings.GetSettingOrEmpty("cssid");
                model.CssClass = block.BaseSettings.GetSettingOrEmpty("cssclass");
                model.LinkUrl  = block.BaseSettings.GetSettingOrEmpty("linkurl");
                model.ImageUrl = model.ImageUrl; // TagReplacer.ReplaceContentTags(model.ImageUrl,
                                                 //               app,
                                                 //               "",
                                                 //               app.IsCurrentRequestSecure());
            }
            return(RenderModel(model));
        }
Exemplo n.º 5
0
 public string Render(MerchantTribe.Commerce.MerchantTribeApplication app, dynamic viewBag, MerchantTribe.Commerce.Content.ContentBlock block)
 {
     return("<div style=\"background:#ffcccc;\">Missing Block: " + block.ControlName + "</div>");
     //return string.Empty;
 }
Exemplo n.º 6
0
        public string Render(MerchantTribe.Commerce.MerchantTribeApplication app, dynamic viewBag, MerchantTribe.Commerce.Content.ContentBlock block)
        {
            string result = string.Empty;

            if (block != null)
            {
                result = block.BaseSettings.GetSettingOrEmpty("HtmlData");
            }
            result = TagReplacer.ReplaceContentTags(result, app, "");
            return(result);
        }
Exemplo n.º 7
0
        string IContentBlockRenderController.Render(MerchantTribe.Commerce.MerchantTribeApplication app, dynamic viewBag, MerchantTribe.Commerce.Content.ContentBlock block)
        {
            string result = string.Empty;

            if (block != null)
            {
                result = block.BaseSettings.GetSettingOrEmpty("HtmlData");
            }
            //result = TagReplacer.ReplaceContentTags(result,
            //                                        app,
            //                                        "",
            //                                        app.IsCurrentRequestSecure());
            return(result);
        }