Strategy to Streamline Plugin Development

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 years ago
I am developing a plugin and would like to find the most efficient way to avoid the required clean and rebuild cycle.  Especially in the beginning, I have a lot of changes I want to make to my cshtml and css, and I don't want to have to clean and rebuild the solution every time I want to see my changes.

I'm considering the following approaches, and wanted to see if anyone can offer guidance...
1. Develop the solution within the Nop.Web project, then extract it to a plugin once the bulk of the development is complete.  This seems pretty straight-forward, but I'm concerned about the amount of possible re-factoring I'll end up doing when extracting it to a plugin.

2. Create a test project that loads the plugin directly.  This seems like a great idea, but I'm not sure how to get started with this approach.  I do need to have the nop context (access to the product catalog, customer, etc.) available during the development of the plugin.

3. Perhaps there's an even better idea I've not considered?

Thanks in advance for your thoughts.
11 years ago
Regarding frequently updating a plugin's views; you can place a plugin's embedded views in the Themes folder so you don't have to rebuild and reload the plugin to see changes. You only have to change the view's filename to match its path and it will be used instead of the embedded view in the plugin.

For example, if your plugin is named Nop.Plugin.Shipping.ByWeight and you are working on the Configure.cshtml view, then the path to this view would be Nop.Plugin.Shipping.ByWeight\Views\ShippingByWeight\Configure.cshtml.

Copy the Configure.cshtml view from
  Nop.Plugin.Shipping.ByWeight\Views\ShippingByWeight\
to
  Presentation\Nop.Web\Themes\DarkOrange\Views\ShippingByWeight\
  (replace DarkOrange with your theme's name and you will have to create the ShippingByWeight folder)

and rename
  Configure.cshtml
to
  Nop.Plugin.Shipping.ByWeight.Views.ShippingByWeight.Configure.cshtml.

Modifying a view in the Themes folder only requires a refresh to see the changes.

---

Once you are finished with the view in the Themes folder, copy its contents to the view in the plugin and rename or delete the one in the theme folder. Then build/reload the plugin to update the embedded view.

.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.