IConsumer Missing

Wednesday, April 24, 2024 5:20:42 AM
  • Posted: Wednesday, July 29, 2020 9:42 PM
  • 3
Hello Everone I want to add a new tab in Product Admin panel. But IConsumer Missing

https://prnt.sc/tqsv0h

Doc : https://docs.grandnode.com/how-to-create-admin-tabs


Waiting for your help Thank you
0
  • Posted: Wednesday, July 29, 2020 9:43 PM
  • 3
John wrote:
Hello Everyone I want to add a new tab in Product Admin panel. But IConsumer Missing

https://prnt.sc/tqsv0h

Doc : https://docs.grandnode.com/how-to-create-admin-tabs


Waiting for your help Thank you
0
  • Posted: Thursday, July 30, 2020 7:08 AM
  • Team
  • 151
Hi,

There are several ways to add new tab on the product.

One of this is:
1. Prepare new plugin as IWidgetPlugin (and set widgetzone = product_details_tabs)
        public IList<string> GetWidgetZones()
        {
            return new List<string> { "product_details_tabs" };
        }
        public void GetPublicViewComponent(string widgetZone, out string viewComponentName)
        {
            viewComponentName = "";
            if (widgetZone == "product_details_tabs")
            {
                viewComponentName = "MyProductViewComponent";
            }
        }

2. Create new class as a component
    [ViewComponent(Name = "MyProductViewComponent")]
    public class MyProductViewComponent : ViewComponent
    {
        public MyProductViewComponent()
        {
        }

        public IViewComponentResult Invoke(string widgetZone, object additionalData)
        {
            if (widgetZone == "product_details_tabs")
            {
                        return View("~/Plugins/Misc.MyPlugin/Views/NewTab.cshtml");
            }

            return Content("");
        }

3. Create new View cshtm file
<tabstrip-item text="My new tab" tab-index="15">
    <content>
        <div>
            Test
        </div>
    </content>
</tabstrip-item>

After installation of plugin do not forget do active the plugin in /Admin/Widget/List
0
  • Posted: Thursday, July 30, 2020 1:27 PM
  • 3
Thank you So much. im try  last question how to find Admin panel widgetzone  list. i check documentation find frontend widgetzone list
http://docs.grandnode.com/widget-zones
0
  • Posted: Thursday, July 30, 2020 7:30 PM
  • 953
Hello John,

In fact, we don't have a list of admin panel widget zones. We will try to list them, for now, please look at the following commit, my collegue Tom added widget zones in admin panel in it. It will give you a short feedback about available widget zones. I hope it will help you.

Cheers!
Best regards,
Patryk

GrandNode Team
0
back to top
Filters