{"id":305853,"date":"2021-09-17T06:55:52","date_gmt":"2021-09-17T06:55:52","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=305853"},"modified":"2024-02-22T08:57:56","modified_gmt":"2024-02-22T08:57:56","slug":"add-tab-on-product-edit-page-using-ui-component","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/add-tab-on-product-edit-page-using-ui-component\/","title":{"rendered":"Add Tab On Product Edit Page Using Ui Component"},"content":{"rendered":"\n<p>Sometimes we need to add a custom tab on the product edit page for separate grouping of attributes, so here we will see how we can achieve that.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Add product_form.xml file<\/h2>\n\n\n\n<p>We need to add product_form.xml inside Vendor\/Module\/view\/adminhtml\/ui_component folder i.e,<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;form xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:module:Magento_Ui:etc\/ui_configuration.xsd&quot;&gt;\n    &lt;htmlContent name=&quot;custom.setting&quot; sortOrder=&quot;6&quot;&gt;\n        &lt;argument name=&quot;data&quot; xsi:type=&quot;array&quot;&gt;\n            &lt;item name=&quot;wrapper&quot; xsi:type=&quot;array&quot;&gt;\n                &lt;item name=&quot;label&quot; xsi:type=&quot;string&quot; translate=&quot;true&quot;&gt;Product Custom Tab&lt;\/item&gt;\n                &lt;item name=&quot;collapsible&quot; xsi:type=&quot;boolean&quot;&gt;true&lt;\/item&gt;\n                &lt;item name=&quot;opened&quot; xsi:type=&quot;boolean&quot;&gt;true&lt;\/item&gt;\n            &lt;\/item&gt;\n        &lt;\/argument&gt;\n        &lt;settings&gt;\n            &lt;wrapper&gt;\n                &lt;canShow&gt;true&lt;\/canShow&gt;\n                &lt;componentType&gt;fieldset&lt;\/componentType&gt;\n            &lt;\/wrapper&gt;\n        &lt;\/settings&gt;\n        &lt;block class=&quot;Vendor\\Module\\Block\\Adminhtml\\Catalog\\Product\\Edit\\CustomTab&quot; name=&quot;custom.setting&quot; &gt;\n            &lt;arguments&gt;\n                &lt;argument name=&quot;config&quot; xsi:type=&quot;array&quot;&gt;\n                    &lt;item name=&quot;label&quot; xsi:type=&quot;string&quot; translate=&quot;true&quot;&gt;Product Custom Tab&lt;\/item&gt;\n                    &lt;item name=&quot;collapsible&quot; xsi:type=&quot;boolean&quot;&gt;true&lt;\/item&gt;\n                    &lt;item name=&quot;opened&quot; xsi:type=&quot;boolean&quot;&gt;false&lt;\/item&gt;\n                    &lt;item name=&quot;sortOrder&quot; xsi:type=&quot;string&quot;&gt;170&lt;\/item&gt;\n                    &lt;item name=&quot;canShow&quot; xsi:type=&quot;boolean&quot;&gt;true&lt;\/item&gt;\n                    &lt;item name=&quot;componentType&quot; xsi:type=&quot;string&quot;&gt;fieldset&lt;\/item&gt;\n                    &lt;item name=&quot;group_code&quot; xsi:type=&quot;string&quot;&gt;advanced&lt;\/item&gt;\n                    &lt;item name=&quot;dataScope&quot; xsi:type=&quot;string&quot;&gt;&lt;\/item&gt;\n                &lt;\/argument&gt;\n            &lt;\/arguments&gt;\n        &lt;\/block&gt;\n    &lt;\/htmlContent&gt;\n&lt;\/form&gt;<\/pre>\n\n\n\n<p>Now create block file <strong>Vendor\\Module\\Block\\Adminhtml\\Catalog\\Product\\Edit\\CustomTab.php<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\n\nnamespace Vendor\\Module\\Block\\Adminhtml\\Catalog\\Product\\Edit;\n\nuse Magento\\Backend\\Block\\Template\\Context;\n \nclass CustomTab extends \\Magento\\Framework\\View\\Element\\Template\n{\n    \/**\n     * @var string\n     *\/\n    protected $_template = &#039;product\/edit\/customtab.phtml&#039;;\n \n    \/**\n     *\n     * @param Context                                  $context\n     * @param array                                    $data\n     *\/\n    public function __construct(\n        Context $context,\n        array $data = &#091;]\n    ) {\n    \n        parent::__construct($context, $data);\n    }\n}<\/pre>\n\n\n\n<p>After creating a block file, we have to create a template file in which we can write our custom code which will be visible inside the custom tab. <br><br>This template file will be called in tab content.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">protected $_template = \u2018product\/edit\/customtab.phtml\u2019<\/pre>\n\n\n\n<p>Now, create template file in location Vendor\/Module\/view\/adminhtml\/templates\/product\/edit\/<\/p>\n\n\n\n<p>Add custom code in this template file.<\/p>\n\n\n\n<p>That&#8217;s all we have to do.<\/p>\n\n\n\n<p>Thank you<br>Happy Coding \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes we need to add a custom tab on the product edit page for separate grouping of attributes, so here we will see how we can achieve that. Add product_form.xml file We need to add product_form.xml inside Vendor\/Module\/view\/adminhtml\/ui_component folder i.e, Now create block file Vendor\\Module\\Block\\Adminhtml\\Catalog\\Product\\Edit\\CustomTab.php After creating a block file, we have to create a <a href=\"https:\/\/webkul.com\/blog\/add-tab-on-product-edit-page-using-ui-component\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":376,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-305853","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Add Tab On Product Edit Page Using Ui Component - Webkul Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/add-tab-on-product-edit-page-using-ui-component\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Add Tab On Product Edit Page Using Ui Component - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"Sometimes we need to add a custom tab on the product edit page for separate grouping of attributes, so here we will see how we can achieve that. Add product_form.xml file We need to add product_form.xml inside Vendor\/Module\/view\/adminhtml\/ui_component folder i.e, Now create block file VendorModuleBlockAdminhtmlCatalogProductEditCustomTab.php After creating a block file, we have to create a [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/add-tab-on-product-edit-page-using-ui-component\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-09-17T06:55:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-02-22T08:57:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Deepak Tiwari\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Deepak Tiwari\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/add-tab-on-product-edit-page-using-ui-component\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/add-tab-on-product-edit-page-using-ui-component\/\"},\"author\":{\"name\":\"Deepak Tiwari\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/f1f005cfc0c9af7f93910041dce67985\"},\"headline\":\"Add Tab On Product Edit Page Using Ui Component\",\"datePublished\":\"2021-09-17T06:55:52+00:00\",\"dateModified\":\"2024-02-22T08:57:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/add-tab-on-product-edit-page-using-ui-component\/\"},\"wordCount\":138,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/add-tab-on-product-edit-page-using-ui-component\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/add-tab-on-product-edit-page-using-ui-component\/\",\"url\":\"https:\/\/webkul.com\/blog\/add-tab-on-product-edit-page-using-ui-component\/\",\"name\":\"Add Tab On Product Edit Page Using Ui Component - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"datePublished\":\"2021-09-17T06:55:52+00:00\",\"dateModified\":\"2024-02-22T08:57:56+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/add-tab-on-product-edit-page-using-ui-component\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/add-tab-on-product-edit-page-using-ui-component\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/add-tab-on-product-edit-page-using-ui-component\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Add Tab On Product Edit Page Using Ui Component\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/f1f005cfc0c9af7f93910041dce67985\",\"name\":\"Deepak Tiwari\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d6f4542bf07455806d05215f870ee8d6ab4bfbdcd1446d3a3143de3b6b0680ba?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d6f4542bf07455806d05215f870ee8d6ab4bfbdcd1446d3a3143de3b6b0680ba?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Deepak Tiwari\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/deepak-tiwari301\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Add Tab On Product Edit Page Using Ui Component - Webkul Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/add-tab-on-product-edit-page-using-ui-component\/","og_locale":"en_US","og_type":"article","og_title":"Add Tab On Product Edit Page Using Ui Component - Webkul Blog","og_description":"Sometimes we need to add a custom tab on the product edit page for separate grouping of attributes, so here we will see how we can achieve that. Add product_form.xml file We need to add product_form.xml inside Vendor\/Module\/view\/adminhtml\/ui_component folder i.e, Now create block file VendorModuleBlockAdminhtmlCatalogProductEditCustomTab.php After creating a block file, we have to create a [...]","og_url":"https:\/\/webkul.com\/blog\/add-tab-on-product-edit-page-using-ui-component\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2021-09-17T06:55:52+00:00","article_modified_time":"2024-02-22T08:57:56+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png","type":"image\/png"}],"author":"Deepak Tiwari","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Deepak Tiwari","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/add-tab-on-product-edit-page-using-ui-component\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/add-tab-on-product-edit-page-using-ui-component\/"},"author":{"name":"Deepak Tiwari","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/f1f005cfc0c9af7f93910041dce67985"},"headline":"Add Tab On Product Edit Page Using Ui Component","datePublished":"2021-09-17T06:55:52+00:00","dateModified":"2024-02-22T08:57:56+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/add-tab-on-product-edit-page-using-ui-component\/"},"wordCount":138,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/add-tab-on-product-edit-page-using-ui-component\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/add-tab-on-product-edit-page-using-ui-component\/","url":"https:\/\/webkul.com\/blog\/add-tab-on-product-edit-page-using-ui-component\/","name":"Add Tab On Product Edit Page Using Ui Component - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"datePublished":"2021-09-17T06:55:52+00:00","dateModified":"2024-02-22T08:57:56+00:00","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/add-tab-on-product-edit-page-using-ui-component\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/add-tab-on-product-edit-page-using-ui-component\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/add-tab-on-product-edit-page-using-ui-component\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Add Tab On Product Edit Page Using Ui Component"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/f1f005cfc0c9af7f93910041dce67985","name":"Deepak Tiwari","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d6f4542bf07455806d05215f870ee8d6ab4bfbdcd1446d3a3143de3b6b0680ba?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d6f4542bf07455806d05215f870ee8d6ab4bfbdcd1446d3a3143de3b6b0680ba?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Deepak Tiwari"},"url":"https:\/\/webkul.com\/blog\/author\/deepak-tiwari301\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/305853","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/376"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=305853"}],"version-history":[{"count":4,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/305853\/revisions"}],"predecessor-version":[{"id":423739,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/305853\/revisions\/423739"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=305853"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=305853"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=305853"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}