Magento 2 + how to remove character limit from meta keyword field in product The 2019 Stack Overflow Developer Survey Results Are InMagento 2.2 - How to remove product Meta Keywords maxlength validation from backend?Magento2 - Remove Meta Keywords from all pagesHow to remove country field from My Account address?Magento 2 -Limit the length of the product name on the front end.How to remove the prefix field from the checkout in 2.2how can i change length of meta description from 255Remove keywords meta tag from head in Magento 2Removal decimals from Quantity on Orders PageHow to increase character limit of text field in Magento 2?Magento 2.2 - How to remove product Meta Keywords maxlength validation from backend?'Migration Meta Information' is not updating when I edit product title/name in magento 2.3

For what reasons would an animal species NOT cross a *horizontal* land bridge?

What is the meaning of Triage in Cybersec world?

Why can I use a list index as an indexing variable in a for loop?

How do I free up internal storage if I don't have any apps downloaded?

If my opponent casts Ultimate Price on my Phantasmal Bear, can I save it by casting Snap or Curfew?

Can a flute soloist sit?

Hello, Goodbye, Adios, Aloha

Cooking pasta in a water boiler

Loose spokes after only a few rides

Do ℕ, mathbbN, BbbN, symbbN effectively differ, and is there a "canonical" specification of the naturals?

What does Linus Torvalds mean when he says that Git "never ever" tracks a file?

Word to describe a time interval

Question on an engine pulling a train

Why did Peik say, "I'm not an animal"?

Magento 2 + how to remove character limit from meta keyword field in product

What is this sharp, curved notch on my knife for?

Geography at the pixel level

How to notate time signature switching consistently every measure

Is it ok to offer lower paid work as a trial period before negotiating for a full-time job?

Why is this recursive code so slow?

What options are there, if any, to get information from an enemy's familiar?

Falsification in Math vs Science

Why don't hard Brexiteers insist on a hard border to prevent illegal immigration after Brexit?

How much of the clove should I use when using big garlic heads?



Magento 2 + how to remove character limit from meta keyword field in product



The 2019 Stack Overflow Developer Survey Results Are InMagento 2.2 - How to remove product Meta Keywords maxlength validation from backend?Magento2 - Remove Meta Keywords from all pagesHow to remove country field from My Account address?Magento 2 -Limit the length of the product name on the front end.How to remove the prefix field from the checkout in 2.2how can i change length of meta description from 255Remove keywords meta tag from head in Magento 2Removal decimals from Quantity on Orders PageHow to increase character limit of text field in Magento 2?Magento 2.2 - How to remove product Meta Keywords maxlength validation from backend?'Migration Meta Information' is not updating when I edit product title/name in magento 2.3



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















How to remove 255 characters limit from meta keywords field in product in admin while saving or updating existing ?



enter image description here



enter image description here










share|improve this question



















  • 1





    You have raised a good point, +1 for that

    – Shoaib Munir
    5 hours ago











  • You would possible need to update catalog_product_entity_varchar to change the value column to either a heigher number or to a text value with no limit

    – Dava Gordon
    4 hours ago











  • I wouldnt recommend adding no more than 10 keyword phrases to a product as they will just be ignored

    – Dava Gordon
    1 hour ago

















2















How to remove 255 characters limit from meta keywords field in product in admin while saving or updating existing ?



enter image description here



enter image description here










share|improve this question



















  • 1





    You have raised a good point, +1 for that

    – Shoaib Munir
    5 hours ago











  • You would possible need to update catalog_product_entity_varchar to change the value column to either a heigher number or to a text value with no limit

    – Dava Gordon
    4 hours ago











  • I wouldnt recommend adding no more than 10 keyword phrases to a product as they will just be ignored

    – Dava Gordon
    1 hour ago













2












2








2








How to remove 255 characters limit from meta keywords field in product in admin while saving or updating existing ?



enter image description here



enter image description here










share|improve this question
















How to remove 255 characters limit from meta keywords field in product in admin while saving or updating existing ?



enter image description here



enter image description here







magento2 admin magento2.2.7 product-edit meta-keywords






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 5 hours ago







Jessy Loran

















asked 5 hours ago









Jessy LoranJessy Loran

456




456







  • 1





    You have raised a good point, +1 for that

    – Shoaib Munir
    5 hours ago











  • You would possible need to update catalog_product_entity_varchar to change the value column to either a heigher number or to a text value with no limit

    – Dava Gordon
    4 hours ago











  • I wouldnt recommend adding no more than 10 keyword phrases to a product as they will just be ignored

    – Dava Gordon
    1 hour ago












  • 1





    You have raised a good point, +1 for that

    – Shoaib Munir
    5 hours ago











  • You would possible need to update catalog_product_entity_varchar to change the value column to either a heigher number or to a text value with no limit

    – Dava Gordon
    4 hours ago











  • I wouldnt recommend adding no more than 10 keyword phrases to a product as they will just be ignored

    – Dava Gordon
    1 hour ago







1




1





You have raised a good point, +1 for that

– Shoaib Munir
5 hours ago





You have raised a good point, +1 for that

– Shoaib Munir
5 hours ago













You would possible need to update catalog_product_entity_varchar to change the value column to either a heigher number or to a text value with no limit

– Dava Gordon
4 hours ago





You would possible need to update catalog_product_entity_varchar to change the value column to either a heigher number or to a text value with no limit

– Dava Gordon
4 hours ago













I wouldnt recommend adding no more than 10 keyword phrases to a product as they will just be ignored

– Dava Gordon
1 hour ago





I wouldnt recommend adding no more than 10 keyword phrases to a product as they will just be ignored

– Dava Gordon
1 hour ago










1 Answer
1






active

oldest

votes


















3














After some debugging I found out that all inputs have 255 length limit and they all have the same template.
The limit is set by the html template itself (kinda hard-coded).
The file path is:




vendor/magento/module-ui/view/base/web/templates/form/element/input.html




So we have to override it into a custom adminhtml theme.



Before you start, please replace the "Vendor" and "Theme" with your "Vendor" and "Module" names



If you do not have one:



Create the following files:




app/design/adminhtml/Vendor/Theme/composer.json





"name": "<vendor>/<theme>",
"description": "N/A",
"require":
"php": "~5.5.0,
"type": "magento2-theme",
"version": "1.0.0",
"license": [

],
"autoload":
"files": [
"registration.php"
]






app/design/adminhtml/Vendor/Theme/registration.php




<?php

MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::THEME,
'adminhtml/<Vendor>/<Theme>',
__DIR__
);



app/design/adminhtml/Vendor/Theme/theme.xml




<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>Theme</title>
<parent>Magento/backend</parent>
</theme>


These are the theme files.



Now we have to create a custom module to make this work:




app/code/Vendor/Theme/registration.php




<?php

MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::MODULE,
'Vendor_Theme',
__DIR__
);



app/code/Vendor/Theme/composer.json





"name": "vendor/theme",
"description": "",
"require":
"php": "~5.5.0,
"suggest":

,
"type": "magento2-module",
"version": "0.1.0",
"license": [

],
"autoload":
"files": [
"registration.php"
],
"psr-4":
"Vendor\Theme\": ""

,
"extra":
"map": [
[
"*",
"Vendor/Theme"
]
]





app/code/Vendor/Theme/etc/module.xml




<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Vendor_Theme" setup_version="0.1.0">
</module>
</config>



app/code/Vendor/Theme/etc/di.xml




<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="MagentoThemeModelViewDesign">
<arguments>
<argument name="themes" xsi:type="array">
<item name="adminhtml" xsi:type="string">Vendor/Theme</item>
</argument>
</arguments>
</type>
</config>


Now we have a custom adminhtml(backend) theme that overrides the Magento_Backend theme.



Here comes the magic:



The input template file for ui components is:




vendor/magento/module-ui/view/base/web/templates/form/element/input.html




We copy it in a relative path in our custom theme:




app/design/adminhtml/Vendor/Theme/Magento_Catalog/web/form/element/input.html




We modify the content into:



<!--Overrides: vendor/magento/module-ui/view/base/web/templates/form/element/input.html -->
<!-- ko if: inputName == "product[meta_keyword]" -->
<input class="admin__control-text" type="text"
data-bind="
event: change: userChanges,
value: value,
hasFocus: focused,
valueUpdate: valueUpdate,
attr:
name: inputName,
placeholder: placeholder,
'aria-describedby': noticeId,
id: uid,
disabled: disabled
"/>
<!--/ko-->
<!-- ko ifnot: inputName == "product[meta_keyword]" -->
<input class="admin__control-text" type="text"
data-bind="
event: change: userChanges,
value: value,
hasFocus: focused,
valueUpdate: valueUpdate,
attr:
name: inputName,
placeholder: placeholder,
'aria-describedby': noticeId,
id: uid,
disabled: disabled,
maxlength: 255
"/>
<!-- /ko -->


As you can see here, we tell to knockoutjs to render the input without the maxlength condition only when the input name is "product[meta_keyword]" (thats our input we want)
else, we render the input normally to not do something we don't want to.



Now, we have to make our template override the Magento_Ui template file:



As we see in the Magento_Ui requirejs_config.js of base,




vendor/magento/module-ui/view/base/requirejs-config.js




There is a namespace for the template paths of the ui components:



....
paths:
'ui/template': 'Magento_Ui/templates'
,
....


That means all the templates paths that are from "Magento_Ui/templates" are replaced with "ui/template".



So, we create our requirejs_config.js:




app/design/adminhtml/Vendor/Theme/Magento_Catalog/requirejs-config.js




var config = 
map:
"*":
"ui/template/form/element/input": "Magento_Catalog/form/element/input"


;


Now clear the cache, clear the static files (or deploy them) and refresh the page, and you should see something like this:



template override inspection



This works for 2.3.1, and it should work for the lower versions






share|improve this answer










New contributor




Luci is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Excellent!! Thanks :)

    – Jessy Loran
    1 hour ago











  • This should and will work for any type of html template override This is one method. There is another method to override the 'global' template by overriding it in the custom theme under its module directory path.

    – Luci
    1 hour ago












Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f269820%2fmagento-2-how-to-remove-character-limit-from-meta-keyword-field-in-product%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









3














After some debugging I found out that all inputs have 255 length limit and they all have the same template.
The limit is set by the html template itself (kinda hard-coded).
The file path is:




vendor/magento/module-ui/view/base/web/templates/form/element/input.html




So we have to override it into a custom adminhtml theme.



Before you start, please replace the "Vendor" and "Theme" with your "Vendor" and "Module" names



If you do not have one:



Create the following files:




app/design/adminhtml/Vendor/Theme/composer.json





"name": "<vendor>/<theme>",
"description": "N/A",
"require":
"php": "~5.5.0,
"type": "magento2-theme",
"version": "1.0.0",
"license": [

],
"autoload":
"files": [
"registration.php"
]






app/design/adminhtml/Vendor/Theme/registration.php




<?php

MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::THEME,
'adminhtml/<Vendor>/<Theme>',
__DIR__
);



app/design/adminhtml/Vendor/Theme/theme.xml




<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>Theme</title>
<parent>Magento/backend</parent>
</theme>


These are the theme files.



Now we have to create a custom module to make this work:




app/code/Vendor/Theme/registration.php




<?php

MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::MODULE,
'Vendor_Theme',
__DIR__
);



app/code/Vendor/Theme/composer.json





"name": "vendor/theme",
"description": "",
"require":
"php": "~5.5.0,
"suggest":

,
"type": "magento2-module",
"version": "0.1.0",
"license": [

],
"autoload":
"files": [
"registration.php"
],
"psr-4":
"Vendor\Theme\": ""

,
"extra":
"map": [
[
"*",
"Vendor/Theme"
]
]





app/code/Vendor/Theme/etc/module.xml




<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Vendor_Theme" setup_version="0.1.0">
</module>
</config>



app/code/Vendor/Theme/etc/di.xml




<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="MagentoThemeModelViewDesign">
<arguments>
<argument name="themes" xsi:type="array">
<item name="adminhtml" xsi:type="string">Vendor/Theme</item>
</argument>
</arguments>
</type>
</config>


Now we have a custom adminhtml(backend) theme that overrides the Magento_Backend theme.



Here comes the magic:



The input template file for ui components is:




vendor/magento/module-ui/view/base/web/templates/form/element/input.html




We copy it in a relative path in our custom theme:




app/design/adminhtml/Vendor/Theme/Magento_Catalog/web/form/element/input.html




We modify the content into:



<!--Overrides: vendor/magento/module-ui/view/base/web/templates/form/element/input.html -->
<!-- ko if: inputName == "product[meta_keyword]" -->
<input class="admin__control-text" type="text"
data-bind="
event: change: userChanges,
value: value,
hasFocus: focused,
valueUpdate: valueUpdate,
attr:
name: inputName,
placeholder: placeholder,
'aria-describedby': noticeId,
id: uid,
disabled: disabled
"/>
<!--/ko-->
<!-- ko ifnot: inputName == "product[meta_keyword]" -->
<input class="admin__control-text" type="text"
data-bind="
event: change: userChanges,
value: value,
hasFocus: focused,
valueUpdate: valueUpdate,
attr:
name: inputName,
placeholder: placeholder,
'aria-describedby': noticeId,
id: uid,
disabled: disabled,
maxlength: 255
"/>
<!-- /ko -->


As you can see here, we tell to knockoutjs to render the input without the maxlength condition only when the input name is "product[meta_keyword]" (thats our input we want)
else, we render the input normally to not do something we don't want to.



Now, we have to make our template override the Magento_Ui template file:



As we see in the Magento_Ui requirejs_config.js of base,




vendor/magento/module-ui/view/base/requirejs-config.js




There is a namespace for the template paths of the ui components:



....
paths:
'ui/template': 'Magento_Ui/templates'
,
....


That means all the templates paths that are from "Magento_Ui/templates" are replaced with "ui/template".



So, we create our requirejs_config.js:




app/design/adminhtml/Vendor/Theme/Magento_Catalog/requirejs-config.js




var config = 
map:
"*":
"ui/template/form/element/input": "Magento_Catalog/form/element/input"


;


Now clear the cache, clear the static files (or deploy them) and refresh the page, and you should see something like this:



template override inspection



This works for 2.3.1, and it should work for the lower versions






share|improve this answer










New contributor




Luci is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Excellent!! Thanks :)

    – Jessy Loran
    1 hour ago











  • This should and will work for any type of html template override This is one method. There is another method to override the 'global' template by overriding it in the custom theme under its module directory path.

    – Luci
    1 hour ago
















3














After some debugging I found out that all inputs have 255 length limit and they all have the same template.
The limit is set by the html template itself (kinda hard-coded).
The file path is:




vendor/magento/module-ui/view/base/web/templates/form/element/input.html




So we have to override it into a custom adminhtml theme.



Before you start, please replace the "Vendor" and "Theme" with your "Vendor" and "Module" names



If you do not have one:



Create the following files:




app/design/adminhtml/Vendor/Theme/composer.json





"name": "<vendor>/<theme>",
"description": "N/A",
"require":
"php": "~5.5.0,
"type": "magento2-theme",
"version": "1.0.0",
"license": [

],
"autoload":
"files": [
"registration.php"
]






app/design/adminhtml/Vendor/Theme/registration.php




<?php

MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::THEME,
'adminhtml/<Vendor>/<Theme>',
__DIR__
);



app/design/adminhtml/Vendor/Theme/theme.xml




<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>Theme</title>
<parent>Magento/backend</parent>
</theme>


These are the theme files.



Now we have to create a custom module to make this work:




app/code/Vendor/Theme/registration.php




<?php

MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::MODULE,
'Vendor_Theme',
__DIR__
);



app/code/Vendor/Theme/composer.json





"name": "vendor/theme",
"description": "",
"require":
"php": "~5.5.0,
"suggest":

,
"type": "magento2-module",
"version": "0.1.0",
"license": [

],
"autoload":
"files": [
"registration.php"
],
"psr-4":
"Vendor\Theme\": ""

,
"extra":
"map": [
[
"*",
"Vendor/Theme"
]
]





app/code/Vendor/Theme/etc/module.xml




<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Vendor_Theme" setup_version="0.1.0">
</module>
</config>



app/code/Vendor/Theme/etc/di.xml




<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="MagentoThemeModelViewDesign">
<arguments>
<argument name="themes" xsi:type="array">
<item name="adminhtml" xsi:type="string">Vendor/Theme</item>
</argument>
</arguments>
</type>
</config>


Now we have a custom adminhtml(backend) theme that overrides the Magento_Backend theme.



Here comes the magic:



The input template file for ui components is:




vendor/magento/module-ui/view/base/web/templates/form/element/input.html




We copy it in a relative path in our custom theme:




app/design/adminhtml/Vendor/Theme/Magento_Catalog/web/form/element/input.html




We modify the content into:



<!--Overrides: vendor/magento/module-ui/view/base/web/templates/form/element/input.html -->
<!-- ko if: inputName == "product[meta_keyword]" -->
<input class="admin__control-text" type="text"
data-bind="
event: change: userChanges,
value: value,
hasFocus: focused,
valueUpdate: valueUpdate,
attr:
name: inputName,
placeholder: placeholder,
'aria-describedby': noticeId,
id: uid,
disabled: disabled
"/>
<!--/ko-->
<!-- ko ifnot: inputName == "product[meta_keyword]" -->
<input class="admin__control-text" type="text"
data-bind="
event: change: userChanges,
value: value,
hasFocus: focused,
valueUpdate: valueUpdate,
attr:
name: inputName,
placeholder: placeholder,
'aria-describedby': noticeId,
id: uid,
disabled: disabled,
maxlength: 255
"/>
<!-- /ko -->


As you can see here, we tell to knockoutjs to render the input without the maxlength condition only when the input name is "product[meta_keyword]" (thats our input we want)
else, we render the input normally to not do something we don't want to.



Now, we have to make our template override the Magento_Ui template file:



As we see in the Magento_Ui requirejs_config.js of base,




vendor/magento/module-ui/view/base/requirejs-config.js




There is a namespace for the template paths of the ui components:



....
paths:
'ui/template': 'Magento_Ui/templates'
,
....


That means all the templates paths that are from "Magento_Ui/templates" are replaced with "ui/template".



So, we create our requirejs_config.js:




app/design/adminhtml/Vendor/Theme/Magento_Catalog/requirejs-config.js




var config = 
map:
"*":
"ui/template/form/element/input": "Magento_Catalog/form/element/input"


;


Now clear the cache, clear the static files (or deploy them) and refresh the page, and you should see something like this:



template override inspection



This works for 2.3.1, and it should work for the lower versions






share|improve this answer










New contributor




Luci is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Excellent!! Thanks :)

    – Jessy Loran
    1 hour ago











  • This should and will work for any type of html template override This is one method. There is another method to override the 'global' template by overriding it in the custom theme under its module directory path.

    – Luci
    1 hour ago














3












3








3







After some debugging I found out that all inputs have 255 length limit and they all have the same template.
The limit is set by the html template itself (kinda hard-coded).
The file path is:




vendor/magento/module-ui/view/base/web/templates/form/element/input.html




So we have to override it into a custom adminhtml theme.



Before you start, please replace the "Vendor" and "Theme" with your "Vendor" and "Module" names



If you do not have one:



Create the following files:




app/design/adminhtml/Vendor/Theme/composer.json





"name": "<vendor>/<theme>",
"description": "N/A",
"require":
"php": "~5.5.0,
"type": "magento2-theme",
"version": "1.0.0",
"license": [

],
"autoload":
"files": [
"registration.php"
]






app/design/adminhtml/Vendor/Theme/registration.php




<?php

MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::THEME,
'adminhtml/<Vendor>/<Theme>',
__DIR__
);



app/design/adminhtml/Vendor/Theme/theme.xml




<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>Theme</title>
<parent>Magento/backend</parent>
</theme>


These are the theme files.



Now we have to create a custom module to make this work:




app/code/Vendor/Theme/registration.php




<?php

MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::MODULE,
'Vendor_Theme',
__DIR__
);



app/code/Vendor/Theme/composer.json





"name": "vendor/theme",
"description": "",
"require":
"php": "~5.5.0,
"suggest":

,
"type": "magento2-module",
"version": "0.1.0",
"license": [

],
"autoload":
"files": [
"registration.php"
],
"psr-4":
"Vendor\Theme\": ""

,
"extra":
"map": [
[
"*",
"Vendor/Theme"
]
]





app/code/Vendor/Theme/etc/module.xml




<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Vendor_Theme" setup_version="0.1.0">
</module>
</config>



app/code/Vendor/Theme/etc/di.xml




<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="MagentoThemeModelViewDesign">
<arguments>
<argument name="themes" xsi:type="array">
<item name="adminhtml" xsi:type="string">Vendor/Theme</item>
</argument>
</arguments>
</type>
</config>


Now we have a custom adminhtml(backend) theme that overrides the Magento_Backend theme.



Here comes the magic:



The input template file for ui components is:




vendor/magento/module-ui/view/base/web/templates/form/element/input.html




We copy it in a relative path in our custom theme:




app/design/adminhtml/Vendor/Theme/Magento_Catalog/web/form/element/input.html




We modify the content into:



<!--Overrides: vendor/magento/module-ui/view/base/web/templates/form/element/input.html -->
<!-- ko if: inputName == "product[meta_keyword]" -->
<input class="admin__control-text" type="text"
data-bind="
event: change: userChanges,
value: value,
hasFocus: focused,
valueUpdate: valueUpdate,
attr:
name: inputName,
placeholder: placeholder,
'aria-describedby': noticeId,
id: uid,
disabled: disabled
"/>
<!--/ko-->
<!-- ko ifnot: inputName == "product[meta_keyword]" -->
<input class="admin__control-text" type="text"
data-bind="
event: change: userChanges,
value: value,
hasFocus: focused,
valueUpdate: valueUpdate,
attr:
name: inputName,
placeholder: placeholder,
'aria-describedby': noticeId,
id: uid,
disabled: disabled,
maxlength: 255
"/>
<!-- /ko -->


As you can see here, we tell to knockoutjs to render the input without the maxlength condition only when the input name is "product[meta_keyword]" (thats our input we want)
else, we render the input normally to not do something we don't want to.



Now, we have to make our template override the Magento_Ui template file:



As we see in the Magento_Ui requirejs_config.js of base,




vendor/magento/module-ui/view/base/requirejs-config.js




There is a namespace for the template paths of the ui components:



....
paths:
'ui/template': 'Magento_Ui/templates'
,
....


That means all the templates paths that are from "Magento_Ui/templates" are replaced with "ui/template".



So, we create our requirejs_config.js:




app/design/adminhtml/Vendor/Theme/Magento_Catalog/requirejs-config.js




var config = 
map:
"*":
"ui/template/form/element/input": "Magento_Catalog/form/element/input"


;


Now clear the cache, clear the static files (or deploy them) and refresh the page, and you should see something like this:



template override inspection



This works for 2.3.1, and it should work for the lower versions






share|improve this answer










New contributor




Luci is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.










After some debugging I found out that all inputs have 255 length limit and they all have the same template.
The limit is set by the html template itself (kinda hard-coded).
The file path is:




vendor/magento/module-ui/view/base/web/templates/form/element/input.html




So we have to override it into a custom adminhtml theme.



Before you start, please replace the "Vendor" and "Theme" with your "Vendor" and "Module" names



If you do not have one:



Create the following files:




app/design/adminhtml/Vendor/Theme/composer.json





"name": "<vendor>/<theme>",
"description": "N/A",
"require":
"php": "~5.5.0,
"type": "magento2-theme",
"version": "1.0.0",
"license": [

],
"autoload":
"files": [
"registration.php"
]






app/design/adminhtml/Vendor/Theme/registration.php




<?php

MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::THEME,
'adminhtml/<Vendor>/<Theme>',
__DIR__
);



app/design/adminhtml/Vendor/Theme/theme.xml




<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>Theme</title>
<parent>Magento/backend</parent>
</theme>


These are the theme files.



Now we have to create a custom module to make this work:




app/code/Vendor/Theme/registration.php




<?php

MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::MODULE,
'Vendor_Theme',
__DIR__
);



app/code/Vendor/Theme/composer.json





"name": "vendor/theme",
"description": "",
"require":
"php": "~5.5.0,
"suggest":

,
"type": "magento2-module",
"version": "0.1.0",
"license": [

],
"autoload":
"files": [
"registration.php"
],
"psr-4":
"Vendor\Theme\": ""

,
"extra":
"map": [
[
"*",
"Vendor/Theme"
]
]





app/code/Vendor/Theme/etc/module.xml




<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Vendor_Theme" setup_version="0.1.0">
</module>
</config>



app/code/Vendor/Theme/etc/di.xml




<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="MagentoThemeModelViewDesign">
<arguments>
<argument name="themes" xsi:type="array">
<item name="adminhtml" xsi:type="string">Vendor/Theme</item>
</argument>
</arguments>
</type>
</config>


Now we have a custom adminhtml(backend) theme that overrides the Magento_Backend theme.



Here comes the magic:



The input template file for ui components is:




vendor/magento/module-ui/view/base/web/templates/form/element/input.html




We copy it in a relative path in our custom theme:




app/design/adminhtml/Vendor/Theme/Magento_Catalog/web/form/element/input.html




We modify the content into:



<!--Overrides: vendor/magento/module-ui/view/base/web/templates/form/element/input.html -->
<!-- ko if: inputName == "product[meta_keyword]" -->
<input class="admin__control-text" type="text"
data-bind="
event: change: userChanges,
value: value,
hasFocus: focused,
valueUpdate: valueUpdate,
attr:
name: inputName,
placeholder: placeholder,
'aria-describedby': noticeId,
id: uid,
disabled: disabled
"/>
<!--/ko-->
<!-- ko ifnot: inputName == "product[meta_keyword]" -->
<input class="admin__control-text" type="text"
data-bind="
event: change: userChanges,
value: value,
hasFocus: focused,
valueUpdate: valueUpdate,
attr:
name: inputName,
placeholder: placeholder,
'aria-describedby': noticeId,
id: uid,
disabled: disabled,
maxlength: 255
"/>
<!-- /ko -->


As you can see here, we tell to knockoutjs to render the input without the maxlength condition only when the input name is "product[meta_keyword]" (thats our input we want)
else, we render the input normally to not do something we don't want to.



Now, we have to make our template override the Magento_Ui template file:



As we see in the Magento_Ui requirejs_config.js of base,




vendor/magento/module-ui/view/base/requirejs-config.js




There is a namespace for the template paths of the ui components:



....
paths:
'ui/template': 'Magento_Ui/templates'
,
....


That means all the templates paths that are from "Magento_Ui/templates" are replaced with "ui/template".



So, we create our requirejs_config.js:




app/design/adminhtml/Vendor/Theme/Magento_Catalog/requirejs-config.js




var config = 
map:
"*":
"ui/template/form/element/input": "Magento_Catalog/form/element/input"


;


Now clear the cache, clear the static files (or deploy them) and refresh the page, and you should see something like this:



template override inspection



This works for 2.3.1, and it should work for the lower versions







share|improve this answer










New contributor




Luci is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this answer



share|improve this answer








edited 2 hours ago





















New contributor




Luci is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









answered 2 hours ago









LuciLuci

465




465




New contributor




Luci is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Luci is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Luci is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • Excellent!! Thanks :)

    – Jessy Loran
    1 hour ago











  • This should and will work for any type of html template override This is one method. There is another method to override the 'global' template by overriding it in the custom theme under its module directory path.

    – Luci
    1 hour ago


















  • Excellent!! Thanks :)

    – Jessy Loran
    1 hour ago











  • This should and will work for any type of html template override This is one method. There is another method to override the 'global' template by overriding it in the custom theme under its module directory path.

    – Luci
    1 hour ago

















Excellent!! Thanks :)

– Jessy Loran
1 hour ago





Excellent!! Thanks :)

– Jessy Loran
1 hour ago













This should and will work for any type of html template override This is one method. There is another method to override the 'global' template by overriding it in the custom theme under its module directory path.

– Luci
1 hour ago






This should and will work for any type of html template override This is one method. There is another method to override the 'global' template by overriding it in the custom theme under its module directory path.

– Luci
1 hour ago


















draft saved

draft discarded
















































Thanks for contributing an answer to Magento Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f269820%2fmagento-2-how-to-remove-character-limit-from-meta-keyword-field-in-product%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to make RAID controller rescan devices The 2019 Stack Overflow Developer Survey Results Are InLSI MegaRAID SAS 9261-8i: Disk isn't recognized after replacementHow to monitor the hard disk status behind Dell PERC H710 Raid Controller with CentOS 6?LSI MegaRAID - Recreate missing RAID 1 arrayext. 2-bay USB-Drive with RAID: btrfs RAID vs built-in RAIDInvalid SAS topologyDoes enabling JBOD mode on LSI based controllers affect existing logical disks/arrays?Why is there a shift between the WWN reported from the controller and the Linux system?Optimal RAID 6+0 Setup for 40+ 4TB DisksAccidental SAS cable removal

Куамањотепек (Чилапа де Алварез) Садржај Становништво Види још Референце Спољашње везе Мени за навигацију17°19′47″N 99°1′51″W / 17.32972° СГШ; 99.03083° ЗГД / 17.32972; -99.0308317°19′47″N 99°1′51″W / 17.32972° СГШ; 99.03083° ЗГД / 17.32972; -99.030838877656„Instituto Nacional de Estadística y Geografía”„The GeoNames geographical database”Мексичка насељапроширитиуу

Can the Right Ascension and Argument of Perigee of a spacecraft's orbit keep varying by themselves with time? The 2019 Stack Overflow Developer Survey Results Are InHow is the altitude of a satellite defined, given that the Earth is not spherical?Why do satellites appear to move faster when overhead and slower closer to the horizon?For the mathematical relationship between J2 (km^5/s^2) and dimensionless J2 - which one is derived from the other?Why is Nodal precession affected by the rotational period of the planet?Why is it so difficult to predict the exact reentry location and time of a very low earth orbit object?Why are low earth orbit satellites not visible from the same place all the time?Perifocal coordinates and the orbit equationHow feasible is the Moonspike mission?What was the typical perigee after a shuttle de-orbit burn?I am having trouble calculating my classic orbital elements and am at a loss on where to lookAm I supposed to modify the gravitational constant with scale and why do fps & time scale changes cause my orbit to break?How Local time of a sun synchronous orbit is related to Right ascension of ascending node?What is wrong with my orbit sim equations? How can I fix them?How to obtain the initial positions and velocities of an inclined orbit?