Пример #1
0
        // GET: Overview
        public ActionResult Index()
        {
            var model = new OverviewList();

            model.AddRange(RenderingContext.Current.ContextItem.GetChildren()
                           .Select(i => new OverviewItem()
            {
                URL              = LinkManager.GetItemUrl(i),
                ContentHeading   = new HtmlString(FieldRenderer.Render(i, "contentheading")),
                DecorationBanner = new HtmlString(FieldRenderer.Render(i, "decorationbanner", "mw=500&mh=333"))
            })
                           );
            return(View(model));
        }
Пример #2
0
        private OverviewList CreateModel()
        {
            var model = new OverviewList();

            model.AddRange(RenderingContext.Current.ContextItem.GetChildren()
                           .Select(item => new OverviewItem()
            {
                Url              = LinkManager.GetItemUrl(item),
                ContentHeading   = new HtmlString(FieldRenderer.Render(item, "ContentHeading")),
                DecorationBanner = new HtmlString(FieldRenderer.Render(item, "DecorationBanner", "mw=500&mh=333"))
            })
                           );

            return(model);
        }
Пример #3
0
        // GET: Overview
        public ActionResult Index()
        {
            var model = new OverviewList()
            {
                ReadMore = Translate.Text("Read More")
            };

            model.AddRange(RenderingContext.Current.Rendering.Item.GetChildren(Sitecore.Collections.ChildListOptions.SkipSorting).OrderByDescending(i => i.Statistics.Created).Select(i => new OverviewItem()
            {
                title = new HtmlString(FieldRenderer.Render(i, "title")),
                image = new HtmlString(FieldRenderer.Render(i, "banner", "mw=500&mh=333")),
                URL   = LinkManager.GetItemUrl(i)
            }
                                                                                                                                                                                      ));
            return(View(model));
        }
        // GET: OverView
        public ActionResult Index()
        {
            var model = new OverviewList()
            {
                ReadMore = Sitecore.Globalization.Translate.Text("Read More")
            };

            model.AddRange(RenderingContext.Current.ContextItem.GetChildren(Sitecore.Collections.ChildListOptions.SkipSorting)
                           .Select(i => new OverviewItem()
            {
                url   = LinkManager.GetItemUrl(i),
                Title = new HtmlString(FieldRenderer.Render(i, "contentheading")),
                Image = new HtmlString(FieldRenderer.Render(i, "decorationbanner", "mw=500&mh=333"))
            }));
            return(View(model));
        }
Пример #5
0
        // GET: Overview
        public ActionResult Index()
        {
            var model = new OverviewList();

            model.AddRange(RenderingContext.Current.ContextItem.GetChildren(Sitecore.Collections.ChildListOptions.SkipSorting)
                           .OrderBy(i => i.Created)
                           .Select(i => new OverviewItem()
            {
                URL            = LinkManager.GetItemUrl(i),
                ContentHeading = new HtmlString(FieldRenderer.Render(i, "contentheading")),
                EventImage     = new HtmlString(FieldRenderer.Render(i, "decorationbanner", "mw=500&mh=333"))
            })

                           );


            return(View(model));
        }
        private OverviewList GetModel()
        {
            var children = RenderingContext.Current.ContextItem.GetChildren(Sitecore.Collections.ChildListOptions.SkipSorting)
                           .OrderBy(i => i.Created)
                           .Select(i => new OverviewItem
            {
                URL   = LinkManager.GetItemUrl(i),
                Title = new HtmlString(FieldRenderer.Render(i, "ContentHeading")),
                Image = new HtmlString(FieldRenderer.Render(i, "DecorationBanner", "mw=500&mh=333")),
            });
            var model = new OverviewList
            {
                ReadMore = Translate.Text("Read More")
            };

            model.AddRange(children);
            return(model);
        }
Пример #7
0
        // GET: Overview
        public ActionResult Index()
        {
            var model = new OverviewList()
            {
                ReadMore = Sitecore.Globalization.Translate.Text("Read More")
            };

            model.AddRange(RenderingContext.Current.ContextItem.GetChildren(ChildListOptions.SkipSorting)
                           //.OrderBy(i=>i.Modified)
                           .OrderBy(i => i.Created)
                           .Select(i => new OverviewItem()
            {
                Url   = LinkManager.GetItemUrl(i),
                Title = new HtmlString(FieldRenderer.Render(i, FieldNameTitle)),
                Image = new HtmlString(FieldRenderer.Render(i, FieldNameImage, "mw=500&mh=333&class=img-responsive"))
            }
                                   ));
            return(View(model));
        }
Пример #8
0
        // GET: Overview
        public ActionResult Index()
        {
            var oList = new OverviewList();

            oList.ReadMore = "Read More";

            var contextItem = RenderingContext.Current.ContextItem;

            oList.AddRange(contextItem.GetChildren()
                           .Select(a => new OverviewItem()
            {
                Title = new HtmlString(a.DisplayName),     // book shows fieldrenderer
                URL   = LinkManager.GetItemUrl(a),
                Image = new HtmlString(FieldRenderer.Render(a, "decorationbanner", "mw=500&mh=333")),
            }));


            return(View(oList));
        }
Пример #9
0
        private void OverviewRefresh_Click(object sender, EventArgs e)
        {
            var list = DataManager.QueryAllInventory();

            OverviewList.BeginUpdate();

            OverviewList.Items.Clear();

            foreach (var item in list)
            {
                var listViewItem = new ListViewItem();

                listViewItem.Text = item.name;
                listViewItem.SubItems.Add(item.number.ToString("###,###"));
                listViewItem.SubItems.Add(item.price.ToString("###,###"));

                OverviewList.Items.Add(listViewItem);
            }

            OverviewList.EndUpdate();
        }
        // GET: Overview
        public ActionResult Index()
        {
            // create a new model
            var model = new OverviewList()
            {
                ReadMore = Sitecore.Globalization.Translate.Text("Read More")
            };

            // add the over view items
            model.AddRange(RenderingContext.Current.ContextItem.GetChildren(Sitecore.Collections.ChildListOptions.SkipSorting)
                           .OrderByDescending(item => item.Created)
                           .Select(item => new OverviewItem()
            {
                Url   = LinkManager.GetItemUrl(item),
                Title = new HtmlString(FieldRenderer.Render(item, "ContentHeading")),
                Image = new HtmlString(FieldRenderer.Render(item, "DecorationBanner", "w=450&h=300"))
            }
                                   ));

            return(View(model));
        }