Plugins are class library which extend the functionalities in BeYourMarket. It allows easy modification, customization, and enhancement in BeYourMarket. Instead of changing the core programming of BeYourMarket, you can add functionality with BeYourMarket Plugins. For example, Payment Plugin to accept/pay using Stripe, or Widget Plugin to add GoogleAnalytics script.
Plugin Name
Plugin name should be simple and short to describe what the Plugin will do. The naming convention should be Plugin.{Group}.{Name}. {Group} is your plugin group (for example, "Payment"). {Name} is your plugin name (for example, "Stripe")
...
In order for the BeYourMarket.Web to know detect the plugin, the compiled dll and corresponding View files needs to be copied to the Plugins directory in BeYourMarket.Web.
...
Code Block |
---|
xcopy /S /Q /Y "$(TargetDir)*" "$(SolutionDir)BeYourMarket.Web\Plugins\Plugin.Widget.GoogleAnalytics\" |
Plugin manifest
For each plugin, manifest.json is required to describe the meta information of the plugin. It's json formatted file used by Plugin Manager in BeYourMarket.Web to get the information of the plugin. Ensure that "Copy to Output Directory" property of this file is set to "Copy if newer".
For example, manifest.json for Plugin.Widget.GoogleAnalytics
Code Block |
---|
{
"Group": "Widget",
"SystemName": "Plugin.Widget.GoogleAnalytics",
"FriendlyName": "Google Analytics",
"Version": "1.0",
"SupportedVersions": ["1.0"],
"Author": "BeYourMarket",
"DisplayOrder": "1",
"PluginFileName": "Plugin.Widget.GoogleAnalytics.dll",
"Description": " |
...
Add Google Analytics script with the tracking id in your marketplace!"
} |
Plugin Manager
To verify plugin are created correctly, compile the solution and start the application BeYourMarket.Web. Go to Admin Panel->Plugins->Manage Plugins
All Plugins detected shall be shown in the list.