Customize palette on sharepoint publishing site with changes

I have a sharepoint publishing site with changes. By default, the wand shows this:

Variation root> English site> Some pages I want to show: "Home"> "Some page", where "Home" points to the root of the English site.

Is there a way to achieve this without creating a custom server control for this?

+4
source share
2 answers

If you know the exact number of levels, you can use SiteMapPath, for example:

<asp:SiteMapPath runat="server" ParentLevelsDisplayed="1" /> 

Otherwise, SiteMapPath always refers to the currently used SiteMapProvider, and you can probably connect to the SiteMapPath rendering to perform a check, for example:

 protected void SiteMapPath_ItemCreated(object sender, SiteMapNodeItemEventArgs e) { if (e.Item.ItemType == SiteMapNodeItemType.Root || (e.Item.ItemType == SiteMapNodeItemType.PathSeparator && e.Item.ItemIndex == 1)) { e.Item.Visible = false; } } 

which will make you SiteMapPath not show rootnode (and the first delimiter).

and if you want your node to display "Home", you can associate it with a different value, for example:

 <asp:SiteMapPath ID="siteMapPath" runat="server" Pathseparator="/" OnItemCreated="SiteMapPath_ItemCreated"> <NodeTemplate> <a href='<%# Eval("url") %>'><%# Eval("description") %></a> </NodeTemplate> <CurrentNodeTemplate> <%# Eval("title") %> </CurrentNodeTemplate> </asp:SiteMapPath> 

if the description is set to "Home" to be displayed.

+2
source

Most recently, I created a couple of new menu controls that solve this problem. My controls accept the ~ Variation / Tokken user parameter as StartNode, so you can create a chunk that starts at your option’s home and not from the root of your site collection. You can find more information @ http://blog.mastykarz.nl/templates-based-menu-control-sharepoint/

0
source

Source: https://habr.com/ru/post/1286298/


All Articles