Skip to content

Commit

Permalink
#2575 Further changes to passing widget zone parameter to widget view…
Browse files Browse the repository at this point in the history
… components
  • Loading branch information
RomanovM committed Sep 28, 2017
1 parent 38e1ab7 commit 0002f8f
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public WidgetsGoogleAnalyticsViewComponent(
this._logger = logger;
}

public IViewComponentResult Invoke(string widgetZone)
public IViewComponentResult Invoke(string widgetZone, object additionalData)
{
string globalScript = "";
var routeData = Url.ActionContext.RouteData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Copyright>Copyright © Nop Solutions, Ltd</Copyright>
<Company>Nop Solutions, Ltd</Company>
<Authors>Nop Solutions, Ltd</Authors>
<Version>1.36</Version>
<Version>1.37</Version>
<Description>This plugin integrates with Google Analytics. It keeps track of statistics about the visitors and ecommerce conversion on your website</Description>
<PackageLicenseUrl></PackageLicenseUrl>
<PackageProjectUrl>http://www.nopcommerce.com/</PackageProjectUrl>
Expand Down
2 changes: 1 addition & 1 deletion src/Plugins/Nop.Plugin.Widgets.GoogleAnalytics/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"Group": "Widgets",
"FriendlyName": "Google Analytics or Universal Analytics",
"SystemName": "Widgets.GoogleAnalytics",
"Version": "1.36",
"Version": "1.37",
"SupportedVersions": [ "4.00" ],
"Author": "nopCommerce team, Nicolas Muniere",
"DisplayOrder": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public WidgetsNivoSliderViewComponent(IStoreContext storeContext,
this._pictureService = pictureService;
}

public IViewComponentResult Invoke(string widgetZone)
public IViewComponentResult Invoke(string widgetZone, object additionalData)
{
var nivoSliderSettings = _settingService.LoadSetting<NivoSliderSettings>(_storeContext.CurrentStore.Id);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Copyright>Copyright © Nop Solutions, Ltd</Copyright>
<Company>Nop Solutions, Ltd</Company>
<Authors>Nop Solutions, Ltd</Authors>
<Version>1.22</Version>
<Version>1.23</Version>
<Description>This plugin allows you to change the contents of main page slider</Description>
<PackageLicenseUrl></PackageLicenseUrl>
<PackageProjectUrl>http://www.nopcommerce.com/</PackageProjectUrl>
Expand Down
2 changes: 1 addition & 1 deletion src/Plugins/Nop.Plugin.Widgets.NivoSlider/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"Group": "Widgets",
"FriendlyName": "Nivo Slider",
"SystemName": "Widgets.NivoSlider",
"Version": "1.22",
"Version": "1.23",
"SupportedVersions": [ "4.00" ],
"Author": "nopCommerce team",
"DisplayOrder": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ public IViewComponentResult Invoke(string widgetZone, object additionalData = nu
var model = new List<RenderWidgetModel>();

//add widget zone to view component arguments
additionalData = new RouteValueDictionary(additionalData)
additionalData = new RouteValueDictionary()
{
{ "widgetZone", widgetZone }
{ "widgetZone", widgetZone },
{ "additionalData", additionalData }
};

var widgets = _widgetService.LoadActiveWidgetsByWidgetZone(widgetZone);
Expand Down
5 changes: 3 additions & 2 deletions src/Presentation/Nop.Web/Factories/WidgetModelFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ public virtual List<RenderWidgetModel> PrepareRenderWidgetModel(string widgetZon
_workContext.CurrentCustomer.Id, _storeContext.CurrentStore.Id, widgetZone, _themeContext.WorkingThemeName);

//add widget zone to view component arguments
additionalData = new RouteValueDictionary(additionalData)
additionalData = new RouteValueDictionary()
{
{ "widgetZone", widgetZone }
{ "widgetZone", widgetZone },
{ "additionalData", additionalData }
};

var cachedModel = _cacheManager.Get(cacheKey, () =>
Expand Down

0 comments on commit 0002f8f

Please sign in to comment.