From 08ac1ff8aa00cf4d457b456b107cd275b24467c5 Mon Sep 17 00:00:00 2001 From: Jesse Maxwell Date: Mon, 9 Jan 2017 19:43:56 -0600 Subject: [PATCH 1/3] Create a standard for XML files --- .../coding-standards/xml-coding-standard.md | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 guides/v2.1/coding-standards/xml-coding-standard.md diff --git a/guides/v2.1/coding-standards/xml-coding-standard.md b/guides/v2.1/coding-standards/xml-coding-standard.md new file mode 100644 index 00000000000..ea865df4fe0 --- /dev/null +++ b/guides/v2.1/coding-standards/xml-coding-standard.md @@ -0,0 +1,59 @@ +--- +layout: default +group: coding-standards +subgroup: Coding standards +title: XML Coding Standards +menu_title: XML Coding Standards +menu_order: 100 +contributor_name: SwiftOtter Studios +contributor_link: https://swiftotter.com/ +version: 2.1 +github_link: coding-standards/xml-coding-standard.md +--- + +# XML Coding Standard + +### Name attribute + +The `name` attribute should adhere to the guidelines listed below. The `name` attribute should: + +- Be unique to the project. +- Use a namespace approach where each child block's name contains its parent's name as well. +- Have segments separated by a `.` (period). +- Be all lowercase. +- Never use `_` (underscores). + +*Example:* + +```xml + + + + + + + +``` + +### As attribute + +The `as` attribute should follow the guidelines below. The value of `as`: + +- Only needs to be unique to the block that contains it. +- Should be as concise as possible, but with enough clarity to be understood within the block. +- Can use an `_` (underscore) as a separator. +- Should only be added if necessary. +- Should be all lowercase. + + +*Example:* + +```xml + + + + + + + +``` From 23550d7eb4d1665d62dba8a997ef9b576158cec7 Mon Sep 17 00:00:00 2001 From: Jesse Maxwell Date: Mon, 9 Jan 2017 19:46:19 -0600 Subject: [PATCH 2/3] Update to clarify that the focus is layout XML --- guides/v2.1/coding-standards/xml-coding-standard.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/guides/v2.1/coding-standards/xml-coding-standard.md b/guides/v2.1/coding-standards/xml-coding-standard.md index ea865df4fe0..e34c288a10d 100644 --- a/guides/v2.1/coding-standards/xml-coding-standard.md +++ b/guides/v2.1/coding-standards/xml-coding-standard.md @@ -2,8 +2,8 @@ layout: default group: coding-standards subgroup: Coding standards -title: XML Coding Standards -menu_title: XML Coding Standards +title: Layout XML Coding Standards +menu_title: Layout XML Coding Standards menu_order: 100 contributor_name: SwiftOtter Studios contributor_link: https://swiftotter.com/ @@ -11,7 +11,7 @@ version: 2.1 github_link: coding-standards/xml-coding-standard.md --- -# XML Coding Standard +# Layout XML Coding Standard ### Name attribute From fa0bf67163b6a6deb60ac2411ea2f59d77e5226d Mon Sep 17 00:00:00 2001 From: Olga Kopylova Date: Fri, 1 Jun 2018 17:00:49 -0500 Subject: [PATCH 3/3] Layout tech guidelines - updated rules for names and aliases - renamed file to be more precise --- ...-standard.md => layout-coding-standard.md} | 22 ++++++------------- 1 file changed, 7 insertions(+), 15 deletions(-) rename guides/v2.1/coding-standards/{xml-coding-standard.md => layout-coding-standard.md} (62%) diff --git a/guides/v2.1/coding-standards/xml-coding-standard.md b/guides/v2.1/coding-standards/layout-coding-standard.md similarity index 62% rename from guides/v2.1/coding-standards/xml-coding-standard.md rename to guides/v2.1/coding-standards/layout-coding-standard.md index e34c288a10d..b731bbec833 100644 --- a/guides/v2.1/coding-standards/xml-coding-standard.md +++ b/guides/v2.1/coding-standards/layout-coding-standard.md @@ -8,7 +8,7 @@ menu_order: 100 contributor_name: SwiftOtter Studios contributor_link: https://swiftotter.com/ version: 2.1 -github_link: coding-standards/xml-coding-standard.md +github_link: coding-standards/layout-coding-standard.md --- # Layout XML Coding Standard @@ -17,8 +17,8 @@ github_link: coding-standards/xml-coding-standard.md The `name` attribute should adhere to the guidelines listed below. The `name` attribute should: -- Be unique to the project. -- Use a namespace approach where each child block's name contains its parent's name as well. +- Should explain element's purpose rather than its position on the page . +- Be unique to the module that declares it by prepending it with module's namespace as `.` - Have segments separated by a `.` (period). - Be all lowercase. - Never use `_` (underscores). @@ -26,12 +26,8 @@ The `name` attribute should adhere to the guidelines listed below. The `name` at *Example:* ```xml - - - - - - + + ``` @@ -49,11 +45,7 @@ The `as` attribute should follow the guidelines below. The value of `as`: *Example:* ```xml - - - - - - + + ```