From c19992ff83d040c280e5729f28a1f123e233c218 Mon Sep 17 00:00:00 2001 From: Sathiya Prakash Date: Thu, 10 Dec 2020 12:30:50 +0530 Subject: [PATCH 01/15] Added an example for overwriting a knockoutjs .html template file in requirejs-config.js by using paths --- .../javascript/requirejs.md | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md b/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md index 985e3932bda..b45f08d2ecf 100644 --- a/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md +++ b/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md @@ -62,6 +62,30 @@ paths: { } ``` +Let us consider an example of overwriting an HTML file in the adminhtml. +In this example, the max-length value of the text-box in the adminhtml is altered. The HTML file is at `vendor/magento/module_ui/view/base/web/templates/form/element/input.html` + +- Create a requirejs-config.js file under `app/code///view/base/` + +```javascript +var config = { + paths: { + 'ui/template/form/element/input': '_/template/form/element/input' + } +}; +``` + +- Create an `input.html` file under `app/code///view/base/web/template/form/` and copy the contents of the input.html file from the `module_ui` template file. + +{:.bs-callout-info} +The path for `Magento_Ui/templates` is set to be `ui/template` in the requirejs-config.js module of `module_ui`, hence `ui/template` is used for specifying the path. If no paths are set, `/templates` should be used. + +- Change the maxlength value to be `512` which was originally set to be `256`. +- Run the Magento setup upgrade and setup compile commands. +- Notice the modification by inspecting the element source code and having a look at the `maxlength` value which is changed to 512 as specified in the template. + +![]({{ site.baseurl }}/common/images/js/max_length.png) + ### deps {#requirejs-config-deps} The `deps` configuration is used to add a dependency. It can either be used directly under `var config = {}` or under a [shim configuration](#requirejs-config-shim). Adding modules under an independent `deps` configuration will load the specified modules in all pages. From f0fc3ffc5e08251b02d19b2c3cb266ddc5b6397e Mon Sep 17 00:00:00 2001 From: Sathiya Prakash Date: Thu, 10 Dec 2020 12:40:55 +0530 Subject: [PATCH 02/15] removed the image --- src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md b/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md index b45f08d2ecf..ed56cbd36dd 100644 --- a/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md +++ b/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md @@ -84,8 +84,6 @@ The path for `Magento_Ui/templates` is set to be `ui/template` in the requirejs- - Run the Magento setup upgrade and setup compile commands. - Notice the modification by inspecting the element source code and having a look at the `maxlength` value which is changed to 512 as specified in the template. -![]({{ site.baseurl }}/common/images/js/max_length.png) - ### deps {#requirejs-config-deps} The `deps` configuration is used to add a dependency. It can either be used directly under `var config = {}` or under a [shim configuration](#requirejs-config-shim). Adding modules under an independent `deps` configuration will load the specified modules in all pages. From a3684e58a4459ea04c904b2e90264269e85ca418 Mon Sep 17 00:00:00 2001 From: Sathiya Prakash Date: Thu, 10 Dec 2020 16:37:17 +0530 Subject: [PATCH 03/15] fixed lint errors --- .../javascript-dev-guide/javascript/requirejs.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md b/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md index ed56cbd36dd..b159432308d 100644 --- a/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md +++ b/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md @@ -62,10 +62,10 @@ paths: { } ``` -Let us consider an example of overwriting an HTML file in the adminhtml. +Let us consider an example of overwriting an HTML file in the adminhtml. In this example, the max-length value of the text-box in the adminhtml is altered. The HTML file is at `vendor/magento/module_ui/view/base/web/templates/form/element/input.html` -- Create a requirejs-config.js file under `app/code///view/base/` +-Create a requirejs-config.js file under `app/code///view/base/` ```javascript var config = { @@ -75,14 +75,14 @@ var config = { }; ``` -- Create an `input.html` file under `app/code///view/base/web/template/form/` and copy the contents of the input.html file from the `module_ui` template file. - +-Create an `input.html` file under `app/code///view/base/web/template/form/` and copy the contents of the input.html file from the `module_ui` template file. + {:.bs-callout-info} The path for `Magento_Ui/templates` is set to be `ui/template` in the requirejs-config.js module of `module_ui`, hence `ui/template` is used for specifying the path. If no paths are set, `/templates` should be used. -- Change the maxlength value to be `512` which was originally set to be `256`. -- Run the Magento setup upgrade and setup compile commands. -- Notice the modification by inspecting the element source code and having a look at the `maxlength` value which is changed to 512 as specified in the template. +-Change the maxlength value to be `512` which was originally set to be `256`. +-Run the Magento setup upgrade and setup compile commands. +-Notice the modification by inspecting the element source code and having a look at the `maxlength` value which is changed to 512 as specified in the template. ### deps {#requirejs-config-deps} From 5869744fe5ac308c978292765119756c927a8fa7 Mon Sep 17 00:00:00 2001 From: Sathiya Prakash Date: Thu, 10 Dec 2020 16:40:32 +0530 Subject: [PATCH 04/15] fixed lint errors --- src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md b/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md index b159432308d..2c10834717c 100644 --- a/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md +++ b/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md @@ -75,7 +75,7 @@ var config = { }; ``` --Create an `input.html` file under `app/code///view/base/web/template/form/` and copy the contents of the input.html file from the `module_ui` template file. +-Create an `input.html` file under `app/code///view/base/web/template/form/` and copy the contents of the input.html file from the `module_ui` template file. {:.bs-callout-info} The path for `Magento_Ui/templates` is set to be `ui/template` in the requirejs-config.js module of `module_ui`, hence `ui/template` is used for specifying the path. If no paths are set, `/templates` should be used. From a088b3e30983e577e912b67c98122004a9780896 Mon Sep 17 00:00:00 2001 From: Sathiya Prakash Date: Thu, 10 Dec 2020 18:56:26 +0530 Subject: [PATCH 05/15] Review comments --- .../javascript-dev-guide/javascript/requirejs.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md b/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md index 2c10834717c..ddd6ea25562 100644 --- a/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md +++ b/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md @@ -62,10 +62,10 @@ paths: { } ``` -Let us consider an example of overwriting an HTML file in the adminhtml. -In this example, the max-length value of the text-box in the adminhtml is altered. The HTML file is at `vendor/magento/module_ui/view/base/web/templates/form/element/input.html` +Consider the example of overwriting an HTML file in the adminhtml. +In this example, the `max-length` value of the text-box in the `adminhtml` is altered. The HTML file is located at `vendor/magento/module_ui/view/base/web/templates/form/element/input.html` --Create a requirejs-config.js file under `app/code///view/base/` +-Create a `requirejs-config.js` file under `app/code///view/base/` ```javascript var config = { @@ -75,14 +75,14 @@ var config = { }; ``` --Create an `input.html` file under `app/code///view/base/web/template/form/` and copy the contents of the input.html file from the `module_ui` template file. +-Create an `input.html` file under `app/code///view/base/web/template/form/` and copy the contents of the `input.html` file from the `module_ui` template file. {:.bs-callout-info} -The path for `Magento_Ui/templates` is set to be `ui/template` in the requirejs-config.js module of `module_ui`, hence `ui/template` is used for specifying the path. If no paths are set, `/templates` should be used. +The path for `Magento_Ui/templates` is set to be `ui/template` in the `requirejs-config.js` module of `module_ui`, hence `ui/template` is used for specifying the path. If no paths are set, `/templates` should be used. -Change the maxlength value to be `512` which was originally set to be `256`. -Run the Magento setup upgrade and setup compile commands. --Notice the modification by inspecting the element source code and having a look at the `maxlength` value which is changed to 512 as specified in the template. +-Confirm the modification by inspecting the element source code and check the `maxlength` value which should have changed to `512` as specified in the template. ### deps {#requirejs-config-deps} From 02fa0071bd837f7639b1776afb7b258a999a14fd Mon Sep 17 00:00:00 2001 From: Sathiya Prakash Date: Thu, 10 Dec 2020 19:03:56 +0530 Subject: [PATCH 06/15] Added spaces after list hyphen --- .../v2.3/javascript-dev-guide/javascript/requirejs.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md b/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md index ddd6ea25562..7fd58d1129b 100644 --- a/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md +++ b/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md @@ -65,7 +65,7 @@ paths: { Consider the example of overwriting an HTML file in the adminhtml. In this example, the `max-length` value of the text-box in the `adminhtml` is altered. The HTML file is located at `vendor/magento/module_ui/view/base/web/templates/form/element/input.html` --Create a `requirejs-config.js` file under `app/code///view/base/` +- Create a `requirejs-config.js` file under `app/code///view/base/` ```javascript var config = { @@ -75,14 +75,14 @@ var config = { }; ``` --Create an `input.html` file under `app/code///view/base/web/template/form/` and copy the contents of the `input.html` file from the `module_ui` template file. +- Create an `input.html` file under `app/code///view/base/web/template/form/` and copy the contents of the `input.html` file from the `module_ui` template file. {:.bs-callout-info} The path for `Magento_Ui/templates` is set to be `ui/template` in the `requirejs-config.js` module of `module_ui`, hence `ui/template` is used for specifying the path. If no paths are set, `/templates` should be used. --Change the maxlength value to be `512` which was originally set to be `256`. --Run the Magento setup upgrade and setup compile commands. --Confirm the modification by inspecting the element source code and check the `maxlength` value which should have changed to `512` as specified in the template. +- Change the maxlength value to be `512` which was originally set to be `256`. +- Run the Magento setup upgrade and setup compile commands. +- Confirm the modification by inspecting the element source code and check the `maxlength` value which should have changed to `512` as specified in the template. ### deps {#requirejs-config-deps} From 1fba1b8cb69a3f44907b8ce425e07eed50e372e8 Mon Sep 17 00:00:00 2001 From: Sathiya Prakash Date: Thu, 10 Dec 2020 19:54:22 +0530 Subject: [PATCH 07/15] review comments --- .../javascript/requirejs.md | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md b/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md index 7fd58d1129b..4e677b942f8 100644 --- a/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md +++ b/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md @@ -65,25 +65,24 @@ paths: { Consider the example of overwriting an HTML file in the adminhtml. In this example, the `max-length` value of the text-box in the `adminhtml` is altered. The HTML file is located at `vendor/magento/module_ui/view/base/web/templates/form/element/input.html` -- Create a `requirejs-config.js` file under `app/code///view/base/` +1. Create a `requirejs-config.js` file under `app/code///view/base/` -```javascript -var config = { - paths: { - 'ui/template/form/element/input': '_/template/form/element/input' - } -}; -``` + ```javascript + var config = { + paths: { + 'ui/template/form/element/input': '_/template/form/element/input' + } + }; + ``` -- Create an `input.html` file under `app/code///view/base/web/template/form/` and copy the contents of the `input.html` file from the `module_ui` template file. +2. Create an `input.html` file under `app/code///view/base/web/template/form/` and copy the contents of the `input.html` file from the `module_ui` template file. +3. Change the maxlength value to be `512` which was originally set to be `256`. +4. Run the Magento setup upgrade and setup compile commands. +5. Confirm the modification by inspecting the element source code and check the `maxlength` value which should have changed to `512` as specified in the template. {:.bs-callout-info} The path for `Magento_Ui/templates` is set to be `ui/template` in the `requirejs-config.js` module of `module_ui`, hence `ui/template` is used for specifying the path. If no paths are set, `/templates` should be used. -- Change the maxlength value to be `512` which was originally set to be `256`. -- Run the Magento setup upgrade and setup compile commands. -- Confirm the modification by inspecting the element source code and check the `maxlength` value which should have changed to `512` as specified in the template. - ### deps {#requirejs-config-deps} The `deps` configuration is used to add a dependency. It can either be used directly under `var config = {}` or under a [shim configuration](#requirejs-config-shim). Adding modules under an independent `deps` configuration will load the specified modules in all pages. From d69ef8349378f7baaa9fc03065a2b1de36f1cb24 Mon Sep 17 00:00:00 2001 From: Sathiya Prakash Date: Thu, 10 Dec 2020 19:57:11 +0530 Subject: [PATCH 08/15] lint errors --- .../v2.3/javascript-dev-guide/javascript/requirejs.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md b/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md index 4e677b942f8..ebf01da5bc0 100644 --- a/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md +++ b/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md @@ -75,10 +75,10 @@ In this example, the `max-length` value of the text-box in the `adminhtml` is al }; ``` -2. Create an `input.html` file under `app/code///view/base/web/template/form/` and copy the contents of the `input.html` file from the `module_ui` template file. -3. Change the maxlength value to be `512` which was originally set to be `256`. -4. Run the Magento setup upgrade and setup compile commands. -5. Confirm the modification by inspecting the element source code and check the `maxlength` value which should have changed to `512` as specified in the template. +1. Create an `input.html` file under `app/code///view/base/web/template/form/` and copy the contents of the `input.html` file from the `module_ui` template file. +1. Change the maxlength value to be `512` which was originally set to be `256`. +1. Run the Magento setup upgrade and setup compile commands. +1. Confirm the modification by inspecting the element source code and check the `maxlength` value which should have changed to `512` as specified in the template. {:.bs-callout-info} The path for `Magento_Ui/templates` is set to be `ui/template` in the `requirejs-config.js` module of `module_ui`, hence `ui/template` is used for specifying the path. If no paths are set, `/templates` should be used. From 8323f562200dce5167f35f136d49a761f497df14 Mon Sep 17 00:00:00 2001 From: Sathiya Prakash <50226394+sathiyaaa@users.noreply.github.com> Date: Mon, 14 Dec 2020 20:38:30 +0530 Subject: [PATCH 09/15] Apply suggestions from code review Co-authored-by: Jeff Matthews --- .../v2.3/javascript-dev-guide/javascript/requirejs.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md b/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md index ebf01da5bc0..e68ad2850c2 100644 --- a/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md +++ b/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md @@ -63,9 +63,9 @@ paths: { ``` Consider the example of overwriting an HTML file in the adminhtml. -In this example, the `max-length` value of the text-box in the `adminhtml` is altered. The HTML file is located at `vendor/magento/module_ui/view/base/web/templates/form/element/input.html` +In this example, the `max-length` value of the text-box in the `adminhtml` is altered. The HTML file is located at `vendor/magento/module_ui/view/base/web/templates/form/element/input.html`. -1. Create a `requirejs-config.js` file under `app/code///view/base/` +1. Create a `requirejs-config.js` file under `app/code///view/base/` and add the following code: ```javascript var config = { @@ -76,9 +76,9 @@ In this example, the `max-length` value of the text-box in the `adminhtml` is al ``` 1. Create an `input.html` file under `app/code///view/base/web/template/form/` and copy the contents of the `input.html` file from the `module_ui` template file. -1. Change the maxlength value to be `512` which was originally set to be `256`. +1. Change the maxlength value to `512`, which was originally set to `256`. 1. Run the Magento setup upgrade and setup compile commands. -1. Confirm the modification by inspecting the element source code and check the `maxlength` value which should have changed to `512` as specified in the template. +1. Confirm the modification by inspecting the element source code and check the `maxlength` value, which should be `512` as specified in the template. {:.bs-callout-info} The path for `Magento_Ui/templates` is set to be `ui/template` in the `requirejs-config.js` module of `module_ui`, hence `ui/template` is used for specifying the path. If no paths are set, `/templates` should be used. From 37c74c0e7408dce7d4924f2145a06f1a38242fc6 Mon Sep 17 00:00:00 2001 From: Sathiya Prakash Date: Mon, 14 Dec 2020 20:41:23 +0530 Subject: [PATCH 10/15] split a point for clarity --- src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md b/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md index e68ad2850c2..fb1e73169d3 100644 --- a/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md +++ b/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md @@ -62,7 +62,7 @@ paths: { } ``` -Consider the example of overwriting an HTML file in the adminhtml. +Consider the example of overwriting an HTML file in the adminhtml. In this example, the `max-length` value of the text-box in the `adminhtml` is altered. The HTML file is located at `vendor/magento/module_ui/view/base/web/templates/form/element/input.html`. 1. Create a `requirejs-config.js` file under `app/code///view/base/` and add the following code: @@ -77,7 +77,8 @@ In this example, the `max-length` value of the text-box in the `adminhtml` is al 1. Create an `input.html` file under `app/code///view/base/web/template/form/` and copy the contents of the `input.html` file from the `module_ui` template file. 1. Change the maxlength value to `512`, which was originally set to `256`. -1. Run the Magento setup upgrade and setup compile commands. +1. Upgrade the Magento application using `bin/magento setup:upgrade`. +1. Generate the dependency injection configuration using `bin/magento setup:di:compile`. 1. Confirm the modification by inspecting the element source code and check the `maxlength` value, which should be `512` as specified in the template. {:.bs-callout-info} From 509b43a3aa3a048c5383db9eb365a0254483df2b Mon Sep 17 00:00:00 2001 From: Sathiya Prakash Date: Mon, 14 Dec 2020 20:44:01 +0530 Subject: [PATCH 11/15] lint errors --- src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md b/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md index fb1e73169d3..d52a82d25af 100644 --- a/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md +++ b/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md @@ -78,7 +78,7 @@ In this example, the `max-length` value of the text-box in the `adminhtml` is al 1. Create an `input.html` file under `app/code///view/base/web/template/form/` and copy the contents of the `input.html` file from the `module_ui` template file. 1. Change the maxlength value to `512`, which was originally set to `256`. 1. Upgrade the Magento application using `bin/magento setup:upgrade`. -1. Generate the dependency injection configuration using `bin/magento setup:di:compile`. +1. Generate the dependency injection configuration using `bin/magento setup:di:compile`. 1. Confirm the modification by inspecting the element source code and check the `maxlength` value, which should be `512` as specified in the template. {:.bs-callout-info} From ced505f81273dcd1c9cac70fb78909d2a6cd8de3 Mon Sep 17 00:00:00 2001 From: Sathiya Prakash Date: Mon, 14 Dec 2020 21:05:51 +0530 Subject: [PATCH 12/15] lint errors --- .../javascript-dev-guide/javascript/requirejs.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md b/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md index d52a82d25af..81cc1f850d0 100644 --- a/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md +++ b/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md @@ -77,9 +77,15 @@ In this example, the `max-length` value of the text-box in the `adminhtml` is al 1. Create an `input.html` file under `app/code///view/base/web/template/form/` and copy the contents of the `input.html` file from the `module_ui` template file. 1. Change the maxlength value to `512`, which was originally set to `256`. -1. Upgrade the Magento application using `bin/magento setup:upgrade`. -1. Generate the dependency injection configuration using `bin/magento setup:di:compile`. -1. Confirm the modification by inspecting the element source code and check the `maxlength` value, which should be `512` as specified in the template. +1. Upgrade the Magento application: + ```bash + bin/magento setup:upgrade + ``` +1. Generate the dependency injection configuration: + ```bash + bin/magento setup:di:compile + ``` +1. Confirm the modification by inspecting the element source code and check the `maxlength` value, which should be `512` as specified in the template. {:.bs-callout-info} The path for `Magento_Ui/templates` is set to be `ui/template` in the `requirejs-config.js` module of `module_ui`, hence `ui/template` is used for specifying the path. If no paths are set, `/templates` should be used. From ddad0c18d97b02788b395c2f78755120a40d31e5 Mon Sep 17 00:00:00 2001 From: Sathiya Prakash Date: Mon, 14 Dec 2020 21:07:33 +0530 Subject: [PATCH 13/15] lint errors --- src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md b/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md index 81cc1f850d0..b6ed4e08fec 100644 --- a/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md +++ b/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md @@ -85,7 +85,7 @@ In this example, the `max-length` value of the text-box in the `adminhtml` is al ```bash bin/magento setup:di:compile ``` -1. Confirm the modification by inspecting the element source code and check the `maxlength` value, which should be `512` as specified in the template. +1. Confirm the modification by inspecting the element source code and check the `maxlength` value, which should be `512` as specified in the template. {:.bs-callout-info} The path for `Magento_Ui/templates` is set to be `ui/template` in the `requirejs-config.js` module of `module_ui`, hence `ui/template` is used for specifying the path. If no paths are set, `/templates` should be used. From 5bdda9ae8312e7d2238fd542d2509e0d2a5bb991 Mon Sep 17 00:00:00 2001 From: Sathiya Prakash Date: Mon, 14 Dec 2020 21:09:12 +0530 Subject: [PATCH 14/15] formatting errors --- src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md b/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md index b6ed4e08fec..4005e8cad1f 100644 --- a/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md +++ b/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md @@ -62,7 +62,7 @@ paths: { } ``` -Consider the example of overwriting an HTML file in the adminhtml. +Consider the example of overwriting an HTML file in the adminhtml. In this example, the `max-length` value of the text-box in the `adminhtml` is altered. The HTML file is located at `vendor/magento/module_ui/view/base/web/templates/form/element/input.html`. 1. Create a `requirejs-config.js` file under `app/code///view/base/` and add the following code: From 7ecbbf692e4a343d922de26becb6a455675f0733 Mon Sep 17 00:00:00 2001 From: Jeff Matthews Date: Mon, 14 Dec 2020 09:44:21 -0600 Subject: [PATCH 15/15] Fixed formatting --- .../v2.3/javascript-dev-guide/javascript/requirejs.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md b/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md index 4005e8cad1f..9b509341c0f 100644 --- a/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md +++ b/src/guides/v2.3/javascript-dev-guide/javascript/requirejs.md @@ -78,13 +78,17 @@ In this example, the `max-length` value of the text-box in the `adminhtml` is al 1. Create an `input.html` file under `app/code///view/base/web/template/form/` and copy the contents of the `input.html` file from the `module_ui` template file. 1. Change the maxlength value to `512`, which was originally set to `256`. 1. Upgrade the Magento application: + ```bash - bin/magento setup:upgrade + bin/magento setup:upgrade ``` + 1. Generate the dependency injection configuration: + ```bash - bin/magento setup:di:compile + bin/magento setup:di:compile ``` + 1. Confirm the modification by inspecting the element source code and check the `maxlength` value, which should be `512` as specified in the template. {:.bs-callout-info}