mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-07-31 18:46:55 +08:00
#19495: Reorganizing MenuItemLink alternates
Work Item: 19495 --HG-- branch : 1.x
This commit is contained in:
parent
684284747f
commit
4cf3db46ec
@ -101,15 +101,25 @@ namespace Orchard.Core.Shapes {
|
||||
builder.Describe("MenuItemLink")
|
||||
.OnDisplaying(displaying => {
|
||||
var menuItem = displaying.Shape;
|
||||
var menu = menuItem.Menu;
|
||||
menuItem.Metadata.Alternates.Add("MenuItemLink__" + EncodeAlternateElement(menu.MenuName));
|
||||
|
||||
string menuName = menuItem.Menu.MenuName;
|
||||
string contentType = null;
|
||||
if (menuItem.Content != null) {
|
||||
var contentType = ((IContent) menuItem.Content).ContentItem.ContentType;
|
||||
if (contentType != null) {
|
||||
menuItem.Metadata.Alternates.Add("MenuItemLink__" + contentType);
|
||||
}
|
||||
contentType = ((IContent) menuItem.Content).ContentItem.ContentType;
|
||||
}
|
||||
|
||||
// MenuItemLink__[ContentType] e.g. MenuItemLink-HtmlMenuItem
|
||||
if (contentType != null) {
|
||||
menuItem.Metadata.Alternates.Add("MenuItemLink__" + EncodeAlternateElement(contentType));
|
||||
}
|
||||
|
||||
// MenuItemLink__[MenuName] e.g. MenuItemLink-Main-Menu
|
||||
menuItem.Metadata.Alternates.Add("MenuItemLink__" + EncodeAlternateElement(menuName));
|
||||
|
||||
// MenuItemLink__[MenuName]__[ContentType] e.g. MenuItemLink-Main-Menu-HtmlMenuItem
|
||||
if (contentType != null) {
|
||||
menuItem.Metadata.Alternates.Add("MenuItemLink__" + EncodeAlternateElement(menuName) + "__" + EncodeAlternateElement(contentType));
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
builder.Describe("LocalMenu")
|
||||
|
Loading…
Reference in New Issue
Block a user