mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Changed the Template title syntax requirements.
This change makes it possible to use "complex" shape names (e.g. "Email__Wrapper"). Before this change, the shape file name syntax was required (e.g. "Email-Wrapper").
However, such shapes would not be found when using the {Shape.Execute} token when using the other syntax (e.g. "Email__Wrapper"), since TemplateShapeDisplayEvent simply register the shapes by specified title without first translating the file based syntax to code based syntax.
This commit is contained in:
@@ -70,13 +70,13 @@ namespace Orchard.Templates.Drivers {
|
||||
return false;
|
||||
|
||||
var name = titleViewModel.Title;
|
||||
if (!string.IsNullOrWhiteSpace(name) &&
|
||||
if (!String.IsNullOrWhiteSpace(name) &&
|
||||
name[0].IsLetter() &&
|
||||
name.All(c => c.IsLetter() || Char.IsDigit(c) || c == '.' || c == '-')) {
|
||||
name.All(c => c.IsLetter() || Char.IsDigit(c) || c == '_')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
updater.AddModelError("Title", T("{0} names can only contain alphanumerical, dot (.) or dash (-) characters and have to start with a letter.", part.ContentItem.TypeDefinition.DisplayName));
|
||||
updater.AddModelError("Title", T("{0} names can only contain alphanumerical or underscore (_) characters and have to start with a letter.", part.ContentItem.TypeDefinition.DisplayName));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user