mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
Fixing that widgets with name containing dash can't have named alternates #3379
This commit is contained in:
parent
7d689710cc
commit
1c4c64b812
@ -39,7 +39,12 @@ namespace Orchard.Widgets {
|
||||
widget.Classes.Add("widget-" + widgetPart.Name);
|
||||
|
||||
// Widget__Name__[Name]
|
||||
displaying.ShapeMetadata.Alternates.Add("Widget__Name__" + widgetPart.Name);
|
||||
if (widgetPart.Name.Contains("-")) {
|
||||
displaying.ShapeMetadata.Alternates.Add("Widget__Name__" + widgetPart.Name.Replace("-", "__"));
|
||||
}
|
||||
else {
|
||||
displaying.ShapeMetadata.Alternates.Add("Widget__Name__" + widgetPart.Name);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user