Hi
I am using nop 4.20 and created a plugin which have to use on product edit page of admin section , So what will will be the process/code to add this plugin widget in product edit page of admin section as a new tab.
here is my code:
public void HandleEvent(AdminTabStripCreated tabEventInfo)
{
if (tabEventInfo != null && !string.IsNullOrEmpty(tabEventInfo.TabStripName))
{
if (tabEventInfo.TabStripName == "attachment-panels")
{
var urlHelper = new UrlHelper(_actionContextAccessor.ActionContext);
object objectId = _actionContextAccessor.ActionContext.RouteData.Values["id"];
if (!string.IsNullOrEmpty(objectId.ToString()))
{
var _localizationService = EngineContext.Current.Resolve<ILocalizationService>();
string text = _localizationService.GetResource("Plugin.Product.Multiple.Attachment");
string SubFolder = _localizationService.GetResource("Plugin.Product.Multiple.Attachment.SubFolder");
string content = urlHelper.RouteUrl("CreateAttachment", new { ProductId = objectId });//SubFolder+"Products/ProductAttachment/Create/" + objectId;//
tabEventInfo.BlocksToRender.Add(new Microsoft.AspNetCore.Html.HtmlString(
"<script>"
+ "$(document).ready(function() {"
+ "$(\"<li><a data-tab-name='tab-additional-tab' data-toggle='tab' href='#tab-additional-tab'>"
+ text + "</a></li> \").appendTo('#attachment-panels .nav-tabs:first');"
+ "$.get('" + content + "', function(result) {"
+ "$(\"<div class='tab-pane' id='tab-additional-tab'>\" + result + \"</div>\").appendTo('#attachment-panels .tab-content:first');"
+ "});"
+ "});"
+ "</script>"));