Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
public class CustomExplorerTree : ExplorerTree
{
public CustomExplorerTree() : base()
{
// Make sure the tree will load your own treebranch
// page, instead of the default
BranchUrl = Global.EPConfig.RootDir +
"templates/ExplorerTreeBranch.aspx";
}
protected override void RenderPageLink(PageTreeReader reader, bool isSelected, HtmlTextWriter output)
{
HyperLink htmlLink = new HyperLink();
htmlLink.ID = "page#" + reader.Page.PageLink.ToString() + "#link";
htmlLink.Text = reader.Page.Property["PageName"].ToWebString();
// Wrapper element for the link with a css class that
// handles wordwrap
HtmlGenericControl div = new HtmlGenericControl("div");
div.Attributes.Add("class", "wordwrapclass");
htmlLink.RenderControl(div);
div.RenderControl(output);
}
}
Create a templates/ExplorerTreeBranch.aspx file (just copy the Util/ExplorerTreeBranch.aspx) and change it so that your custom ExplorerTree is loaded:
<%@ Register TagPrefix="dev" Namespace="development" Assembly="EPiServerSample" %>
...
.wordwrapclass
{
word-wrap:break-word;
}
htmlLink.Text = reader.Page.Property["PageName"].ToWebString();
but if you change it to htmlLink.Text = reader.Page.PageName;
you can get it to work.