-
-
Save mpj/285840 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Web; | |
using EPiServer; | |
using EPiServer.Core; | |
namespace AbsolutCom | |
{ | |
public partial class Navigation : Absolut.EPiServer.UI.PageBase | |
{ | |
protected override void OnLoad(EventArgs e) | |
{ | |
Response.ContentType = "text/javascript"; | |
String baseURL = CurrentPage.Property["strImgBaseUrl"].ToString(); | |
ctrlSeparator.Text = String.Concat(baseURL, CurrentPage.Property["imgSeparator"].ToString()); | |
ctrlBackgroundImage.Text = String.Concat(baseURL, CurrentPage.Property["imgBackground"].ToString()); | |
ctrlBackgroundColor.Text = CurrentPage.Property["strBackgroundColor"].ToString(); | |
ctrlHeight.Text = String.Concat(CurrentPage.Property["intHeightInPx"].ToString(), "px"); | |
String activeItem = ""; | |
if (Request.QueryString["active"] != null) | |
activeItem = Request.QueryString["active"].ToString().ToLower(); | |
ArrayList navItems = new ArrayList(); | |
PageDataCollection pdc = GetChildren(CurrentPage.PageLink); | |
foreach (PageData child in pdc) | |
if (child.StopPublish > DateTime.Now) | |
{ | |
{ | |
if (child.PageName.ToLower().StartsWith(activeItem) && activeItem.Length > 1) | |
{ | |
navItems.Add(String.Format("createNavImage('{0}{1}', '{0}{1}')", | |
baseURL, | |
child.Property["urlActiveImage"].ToString())); | |
} | |
else | |
{ | |
string link = child.Property["strLinkDestination"].ToString(); | |
if (!link.Contains("?") && !link.EndsWith("/")) | |
{ | |
link = string.Concat(link, "/"); | |
} | |
navItems.Add(String.Format("createLink('{1}', '{0}{2}', '{0}{3}')", | |
baseURL, | |
link, | |
child.Property["urlDefaultImage"].ToString(), | |
child.Property["urlMouseOverImage"].ToString())); | |
} | |
} | |
} | |
rptNavItems.DataSource = navItems; | |
rptNavItems.DataBind(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment