protected override void RenderPart(LinqIt.Utils.Web.HtmlWriter writer) { var topMenuItems = DataService.Instance.GetTopMenuItems(); writer.RenderBeginTag(HtmlTextWriterTag.Ul, "nav"); foreach (var topItem in topMenuItems) { if (topItem.HasChildren) writer.AddClass("dropdown"); writer.RenderBeginTag(HtmlTextWriterTag.Li); writer.AddAttribute(HtmlTextWriterAttribute.Href, topItem.Url); writer.RenderFullTag(HtmlTextWriterTag.A, topItem.DisplayName); if (topItem.HasChildren) { writer.AddAttribute("data-toggle", "dropdown"); writer.AddAttribute(HtmlTextWriterAttribute.Href, "#"); writer.RenderBeginTag(HtmlTextWriterTag.A, "dropdown-toggle"); writer.RenderFullTag(HtmlTextWriterTag.B, "", "caret"); writer.RenderEndTag(); // a.dropdown-toggle writer.RenderBeginTag(HtmlTextWriterTag.Ul, "dropdown-menu"); foreach (var child in topItem.Children) { writer.RenderBeginTag(HtmlTextWriterTag.Li); writer.AddAttribute(HtmlTextWriterAttribute.Href, child.Url); writer.RenderFullTag(HtmlTextWriterTag.A, child.DisplayName); writer.RenderEndTag(); // li } writer.RenderEndTag(); // ul.dropdown-menu } writer.RenderEndTag(); // li } writer.RenderEndTag(); // ul.nav }
private static void RenderMenuItem(LinqIt.Utils.Web.HtmlWriter writer, Logic.Entities.MenuItem menuItem) { writer.RenderBeginTag(HtmlTextWriterTag.Li, menuItem.Active? "active" : null); writer.RenderLinkTag(menuItem.Url, menuItem.DisplayName); if (menuItem.HasChildren) { writer.RenderBeginTag(HtmlTextWriterTag.Ul); foreach (var child in menuItem.Children) RenderMenuItem(writer, child); writer.RenderEndTag(); } writer.RenderEndTag(); //li }
protected override void RenderPart(LinqIt.Utils.Web.HtmlWriter writer) { if (Visible) { writer.AddAttribute("action", "Søg"); writer.RenderBeginTag(HtmlTextWriterTag.Div, "navbar-search pull-right"); writer.AddAttribute(HtmlTextWriterAttribute.Type, "text"); writer.AddAttribute("placeholder", "Søg"); writer.RenderFullTag(HtmlTextWriterTag.Input, "", "search-query"); writer.AddAttribute(HtmlTextWriterAttribute.Type, "submit"); writer.RenderBeginTag(HtmlTextWriterTag.Button, "btn"); writer.RenderFullTag(HtmlTextWriterTag.Span, "Submit"); writer.RenderEndTag(); // button.btn writer.RenderEndTag(); // div.navbar-search pull-right } }
protected override void RenderPart(LinqIt.Utils.Web.HtmlWriter writer) { using (var service = new SearchService("site")) { var q = BooleanQuery.Or(Request.QueryString["query"].ToLower().Split(' ').Where(s => !string.IsNullOrEmpty(s)).Select(s => new WildCardQuery("text", "*" + s + "*")).ToArray()); var result = service.Search(q, 0, int.MaxValue); foreach (var record in result.Records) { writer.RenderBeginTag(HtmlTextWriterTag.Div, "search-result"); writer.RenderBeginTag(HtmlTextWriterTag.H3); writer.RenderLinkTag(record.GetString("url"), record.GetString("title")); writer.RenderEndTag(); writer.RenderFullTag(HtmlTextWriterTag.Div, record.GetString("text")); writer.RenderEndTag(); } } }
protected override void RenderPart(LinqIt.Utils.Web.HtmlWriter writer) { var subItems = DataService.Instance.GetSubMenuItems(); if (!subItems.Any()) return; writer.RenderBeginTag(HtmlTextWriterTag.Div, "subnav"); writer.RenderBeginTag(HtmlTextWriterTag.Ul, "nav nav-pills"); foreach (var menuItem in subItems) { writer.RenderBeginTag(HtmlTextWriterTag.Li); writer.RenderLinkTag(menuItem.Url, menuItem.DisplayName); writer.RenderEndTag(); // li } writer.RenderEndTag(); // ul.nav nav-pills writer.RenderEndTag(); // div.subnav }
protected override void RenderPart(LinqIt.Utils.Web.HtmlWriter writer) { var menuItems = DataService.Instance.GetSideMenuItems(); if (!menuItems.Any()) return; writer.GoogleOff(); writer.RenderBeginTag(HtmlTextWriterTag.Div, "well"); writer.RenderBeginTag(HtmlTextWriterTag.Ul, "nav nav-list"); foreach (var menuItem in menuItems) RenderMenuItem(writer, menuItem); writer.RenderEndTag(); // ul.nav nav-list writer.RenderEndTag(); // div.well writer.GoogleOn(); }
protected override void RenderPart(LinqIt.Utils.Web.HtmlWriter writer) { if (!Visible) return; writer.RenderBeginTag(HtmlTextWriterTag.Div, "navbar"); writer.RenderBeginTag(HtmlTextWriterTag.Div, "navbar-inner"); writer.RenderBeginTag(HtmlTextWriterTag.Ul, "nav"); foreach (var menuItem in _menuItems) { if (menuItem.Selected || menuItem.Expanded) writer.AddClass("active"); writer.RenderBeginTag(HtmlTextWriterTag.Li); writer.AddAttribute(HtmlTextWriterAttribute.Href, menuItem.Url); writer.RenderFullTag(HtmlTextWriterTag.A, menuItem.DisplayName); writer.RenderEndTag(); // li.active } writer.RenderEndTag(); // ul.nav writer.RenderEndTag(); // div.navbar-inner writer.RenderEndTag(); // div.navbar }
public override void Render(LinqIt.Utils.Web.HtmlWriter writer, int pageNumber, int firstPage, int lastPage, int pages, bool showEnds) { writer.RenderBeginTag(HtmlTextWriterTag.Div, "pagination"); writer.RenderBeginTag(HtmlTextWriterTag.Ul); if (pageNumber > 1) RenderPageLink(writer, pageNumber - 1, "Prev", "", false); else RenderPageLink(writer, null, "Prev", "disabled", false); for (var i = firstPage; i <= lastPage; i++) RenderPageLink(writer, i == pageNumber ? (int?)null : i, i.ToString(), i == pageNumber ? "disabled" : null, false); if (pageNumber < pages) RenderPageLink(writer, pageNumber + 1, "Next", "", false); else RenderPageLink(writer, null, "Next", "disabled", false); writer.RenderEndTag(); // ul writer.RenderEndTag(); // div.pagination }
protected override void RenderPart(LinqIt.Utils.Web.HtmlWriter writer) { var configuration = CmsService.Instance.GetConfigurationItem<ServiceMenuConfiguration>("Service Menu"); if (configuration == null) return; var items = configuration.Items; if (!items.Any()) return; writer.RenderBeginTag(HtmlTextWriterTag.Div, "section"); writer.RenderBeginTag(HtmlTextWriterTag.Ul, "nav nav-pills pull-right"); foreach (var item in items) { writer.RenderBeginTag(HtmlTextWriterTag.Li); writer.AddAttribute(HtmlTextWriterAttribute.Href, item.Href); writer.RenderFullTag(HtmlTextWriterTag.A, item.Title); writer.RenderEndTag(); // li } writer.RenderEndTag(); // ul.nav nav-pills pull-right writer.RenderEndTag(); // div.section }
private static void RenderMenuItem(LinqIt.Utils.Web.HtmlWriter writer, Entities.MenuItem menuItem) { if (menuItem.Selected) writer.AddClass("selected"); if (menuItem.Expanded) writer.AddClass("expanded"); if (menuItem.Collapsed) writer.AddClass("collapsed"); writer.RenderBeginTag(HtmlTextWriterTag.Li); writer.AddAttribute(HtmlTextWriterAttribute.Href, menuItem.Url); writer.RenderBeginTag(HtmlTextWriterTag.A); writer.RenderFullTag(HtmlTextWriterTag.Span, menuItem.DisplayName); writer.RenderEndTag(); // a if (menuItem.HasChildren) { writer.RenderBeginTag(HtmlTextWriterTag.Ul); foreach (var child in menuItem.Children) RenderMenuItem(writer, child); writer.RenderEndTag(); // ul } writer.RenderEndTag(); // li }
protected override void RenderPart(LinqIt.Utils.Web.HtmlWriter writer) { if (!Visible) return; writer.RenderBeginTag(HtmlTextWriterTag.Ul, "breadcrumb"); writer.RenderFullTag(HtmlTextWriterTag.Li, "Du er her:"); for (var i = 0; i < _menuItems.Length; i++) { if (i == _menuItems.Length-1) { writer.RenderFullTag(HtmlTextWriterTag.Li, _menuItems[i].DisplayName, "active"); } else { writer.AddAttribute(HtmlTextWriterAttribute.Href, _menuItems[i].Url); writer.RenderFullTag(HtmlTextWriterTag.A, _menuItems[i].DisplayName); writer.RenderFullTag(HtmlTextWriterTag.Span, "/", "divider"); } } writer.RenderEndTag(); // ul.breadcrumb }
protected override void RenderPart(LinqIt.Utils.Web.HtmlWriter writer) { var topMenuItems = DataService.Instance.GetTopMenuItems(); writer.AddAttribute(HtmlTextWriterAttribute.Style, "clear:both;"); writer.RenderBeginTag(HtmlTextWriterTag.Div, "btn-toolbar"); foreach (var topItem in topMenuItems) { if (topItem.HasChildren) { writer.RenderBeginTag(HtmlTextWriterTag.Div, "btn-group"); writer.AddAttribute(HtmlTextWriterAttribute.Href, topItem.Url); writer.RenderFullTag(HtmlTextWriterTag.A, topItem.DisplayName, "btn btn-primary"); writer.AddAttribute("data-toggle", "dropdown"); writer.RenderBeginTag(HtmlTextWriterTag.Button, "btn dropdown-toggle"); writer.RenderFullTag(HtmlTextWriterTag.Span, "", "caret"); writer.RenderEndTag(); // button.btn dropdown-toggle writer.RenderBeginTag(HtmlTextWriterTag.Ul, "dropdown-menu"); foreach (var child in topItem.Children) { writer.RenderBeginTag(HtmlTextWriterTag.Li); writer.AddAttribute(HtmlTextWriterAttribute.Href, child.Url); writer.RenderFullTag(HtmlTextWriterTag.A, child.DisplayName); writer.RenderEndTag(); // li } writer.RenderEndTag(); // ul.dropdown-menu writer.RenderEndTag(); // div.btn-group } else { writer.RenderBeginTag(HtmlTextWriterTag.Div, "btn-group"); writer.AddAttribute(HtmlTextWriterAttribute.Href, topItem.Url); writer.RenderFullTag(HtmlTextWriterTag.A, topItem.DisplayName, "btn btn-primary"); writer.RenderEndTag(); // div.btn-group } } writer.RenderEndTag(); // div.btn-toolbar }