Skip to content

Commit aa87712

Browse files
authored
Merge pull request #23 from umbraco/v9/bugfix/partial-view-missing
V9/bugfix/partial view missing
2 parents b26a2a5 + a96ed43 commit aa87712

File tree

7 files changed

+39
-7
lines changed

7 files changed

+39
-7
lines changed

azure-pipelines - Commerce.Shopify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
trigger:
2-
- main
2+
- v9/bugfix/partial-view-missing
33

44
pool:
55
vmImage: 'windows-latest'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@inherits Umbraco.Web.Mvc.UmbracoViewPage<List<Umbraco.Cms.Integrations.Commerce.Shopify.Models.ViewModels.ProductViewModel>>
2+
3+
<dl class="products-list">
4+
@foreach (var product in Model)
5+
{
6+
<dt class="product-title">@product.Title</dt>
7+
<dd class="product-body">@Html.Raw(product.Body)</dd>
8+
<img class="product-image" src="@product.Image" alt="@product.Title" />
9+
}
10+
</dl>
11+
12+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<List<Umbraco.Cms.Integrations.Commerce.Shopify.Models.ViewModels.ProductViewModel>>
2+
3+
<dl class="products-list">
4+
@foreach (var product in Model)
5+
{
6+
<dt class="product-title">@product.Title</dt>
7+
<dd class="product-body">@Html.Raw(product.Body)</dd>
8+
<img class="product-image" src="@product.Image" alt="@product.Title" />
9+
}
10+
</dl>
11+
12+
13+

src/Umbraco.Cms.Integrations.Commerce.Shopify/Constants.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ public static class Constants
1414

1515
public const string AppPluginFolderPath = "~/App_Plugins/UmbracoCms.Integrations/Commerce/Shopify";
1616

17+
public static class RenderingComponent
18+
{
19+
public const string DefaultV8ViewPath = AppPluginFolderPath + "/Render/Products.cshtml";
20+
21+
public const string DefaultV9ViewPath = AppPluginFolderPath + "/Render/ProductsV9.cshtml";
22+
}
23+
1724
public static class Configuration
1825
{
1926
public const string Settings = "Umbraco:Cms:Integrations:Commerce:Shopify:Settings";

src/Umbraco.Cms.Integrations.Commerce.Shopify/Helpers/HtmlHelper.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ namespace Umbraco.Cms.Integrations.Commerce.Shopify.Helpers
1717
public static class ShopifyHtmlExtensions
1818
{
1919
#if NETCOREAPP
20-
public static IHtmlContent RenderShopifyProductsList(this HtmlHelper htmlHelper, List<ProductViewModel> vm)
20+
public static IHtmlContent RenderShopifyProductsList(this IHtmlHelper<dynamic> htmlHelper, List<ProductViewModel> vm, string renderingViewPath = "")
2121
{
22-
return htmlHelper.Partial($"{Constants.AppPluginFolderPath}/Render/Products.cshtml", vm);
22+
return htmlHelper.Partial(string.IsNullOrEmpty(renderingViewPath) ? Constants.RenderingComponent.DefaultV9ViewPath : renderingViewPath, vm);
2323
}
2424
#else
25-
public static IHtmlString RenderShopifyProductsList(this HtmlHelper htmlHelper, List<ProductViewModel> vm)
25+
public static IHtmlString RenderShopifyProductsList(this HtmlHelper htmlHelper, List<ProductViewModel> vm, string renderingViewPath = "")
2626
{
27-
return htmlHelper.Partial($"{Constants.AppPluginFolderPath}/Render/Products.cshtml", vm);
27+
return htmlHelper.Partial(string.IsNullOrEmpty(renderingViewPath) ? Constants.RenderingComponent.DefaultV8ViewPath : renderingViewPath, vm);
2828
}
2929
#endif
3030
}

src/Umbraco.Cms.Integrations.Commerce.Shopify/Umbraco.Cms.Integrations.Commerce.Shopify.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<PackageIconUrl></PackageIconUrl>
1111
<PackageProjectUrl>https://github.com/umbraco/Umbraco.Cms.Integrations</PackageProjectUrl>
1212
<RepositoryUrl>https://github.com/umbraco/Umbraco.Cms.Integrations</RepositoryUrl>
13-
<Version>1.0.0</Version>
13+
<Version>1.0.1</Version>
1414
<Authors>Umbraco HQ</Authors>
1515
<Company>Umbraco</Company>
1616
</PropertyGroup>

src/Umbraco.Cms.Integrations.Commerce.Shopify/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<info>
44
<package>
55
<name>Umbraco.Cms.Integrations.Commerce.Shopify</name>
6-
<version>1.0.0</version>
6+
<version>1.0.1</version>
77
<iconUrl></iconUrl>
88
<licence url="https://opensource.org/licenses/MIT">MIT</licence>
99
<url>https://github.com/umbraco/Umbraco.Cms.Integrations</url>

0 commit comments

Comments
 (0)