Skip to content

Commit

Permalink
Merge pull request #29 from Sitecore/feature/20/consolidate-sitecoreh…
Browse files Browse the repository at this point in the history
…elper-extensions

[closes #20] created and consolidated SitecoreHelper extensions
  • Loading branch information
nickwesselman authored May 7, 2019
2 parents ea269ee + 3f458af commit 7df6b8e
Show file tree
Hide file tree
Showing 27 changed files with 373 additions and 110 deletions.
10 changes: 10 additions & 0 deletions basic-company/project-per-module-unicorn/BasicCompany.sln
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Services", "Services", "{11
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BasicCompany.Feature.Services", "src\Feature\Services\website\BasicCompany.Feature.Services.csproj", "{087D93EB-261B-4C05-A72F-5E72C4D7F043}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "FieldRendering", "FieldRendering", "{F4D57DAD-E44A-49D3-BCF9-7F37B615ABBE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BasicCompany.Foundation.FieldRendering", "src\Foundation\FieldRendering\website\BasicCompany.Foundation.FieldRendering.csproj", "{508C9659-2186-4655-B24A-F2DE3744BAB5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -99,6 +103,10 @@ Global
{087D93EB-261B-4C05-A72F-5E72C4D7F043}.Debug|Any CPU.Build.0 = Debug|Any CPU
{087D93EB-261B-4C05-A72F-5E72C4D7F043}.Release|Any CPU.ActiveCfg = Release|Any CPU
{087D93EB-261B-4C05-A72F-5E72C4D7F043}.Release|Any CPU.Build.0 = Release|Any CPU
{508C9659-2186-4655-B24A-F2DE3744BAB5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{508C9659-2186-4655-B24A-F2DE3744BAB5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{508C9659-2186-4655-B24A-F2DE3744BAB5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{508C9659-2186-4655-B24A-F2DE3744BAB5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -123,6 +131,8 @@ Global
{05C712E6-E8C5-4744-B8E0-3C9D07571B0A} = {CDB84AC1-5A02-4C07-954B-45AD9542104B}
{1114AD54-BF0A-41FC-82F6-E2F5E215885C} = {EBD32547-E4EC-47C5-AD12-0188C2ECE110}
{087D93EB-261B-4C05-A72F-5E72C4D7F043} = {1114AD54-BF0A-41FC-82F6-E2F5E215885C}
{F4D57DAD-E44A-49D3-BCF9-7F37B615ABBE} = {D0DD1773-D94E-47FC-9310-952C4ECEF69A}
{508C9659-2186-4655-B24A-F2DE3744BAB5} = {F4D57DAD-E44A-49D3-BCF9-7F37B615ABBE}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7A7C4987-3A11-41A9-8915-5457EF7B5A6F}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
<Content Include="App_Config\Include\Feature\Feature.BasicContent.Serialization.config" />
</ItemGroup>
<ItemGroup>
<Compile Include="Extensions\SitecoreHelperExtensions.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Templates.cs" />
</ItemGroup>
Expand All @@ -76,7 +75,12 @@
<DependentUpon>web.config</DependentUpon>
</None>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<ProjectReference Include="..\..\..\Foundation\FieldRendering\website\BasicCompany.Foundation.FieldRendering.csproj">
<Project>{508c9659-2186-4655-b24a-f2de3744bab5}</Project>
<Name>BasicCompany.Foundation.FieldRendering</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
@model RenderingModel
@using BasicCompany.Feature.BasicContent
@using BasicCompany.Foundation.FieldRendering
@{
// always render accordions open in EE with button hidden
string bodyStyle = Sitecore.Context.PageMode.IsExperienceEditor ?
"max-height: 100rem" : null;
}
<div class="accordion-item">
<div class="accordion-header">
<h3>@Html.Sitecore().Field(Templates.AccordionItem.Fields.Title.ToString())</h3>
<h3>@Html.Sitecore().Field(Templates.AccordionItem.Fields.Title)</h3>
<button></button>
</div>
<div class="accordion-body" style="@bodyStyle">
@Html.Sitecore().Field(Templates.AccordionItem.Fields.Content.ToString())
@Html.Sitecore().Field(Templates.AccordionItem.Fields.Content)
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
@using BasicCompany.Feature.BasicContent
@using BasicCompany.Feature.BasicContent.Extensions
@using BasicCompany.Foundation.FieldRendering

<section class="hero is-medium is-black" style="background-image: url(@Html.Sitecore().MediaUrl(Templates.HeroBanner.Fields.Image))">
<div class="hero-body">
<div class="container">
<h1 class="title">
@Html.Sitecore().Field(Templates.HeroBanner.Fields.Title.ToString())
@Html.Sitecore().Field(Templates.HeroBanner.Fields.Title)
</h1>
<h2 class="subtitle">
@Html.Sitecore().Field(Templates.HeroBanner.Fields.Subtitle.ToString())
@Html.Sitecore().Field(Templates.HeroBanner.Fields.Subtitle)
</h2>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
@model Sitecore.Mvc.Presentation.RenderingModel
@using BasicCompany.Feature.BasicContent
@using BasicCompany.Feature.BasicContent.Extensions
@using BasicCompany.Foundation.FieldRendering

@* Disable editing to improve component selection in editor. Can be edited via field editor button. *@
@Html.Sitecore().BeginField(Templates.PromoCard.Fields.Link.ToString(), new { @class = "column promo-column", DisableWebEdit = true })
<div class="card">
<div class="card-image">
<figure style="background-image: url(@Html.Sitecore().MediaUrl(Templates.PromoCard.Fields.Image))"></figure>
</div>
<div class="card-content">
<div class="content">
<h4>@Html.Sitecore().Field(Templates.PromoCard.Fields.Headline.ToString())</h4>
@Html.Sitecore().Field(Templates.PromoCard.Fields.Text.ToString())
</div>
<div class="card">
<div class="card-image">
<figure style="background-image: url(@Html.Sitecore().MediaUrl(Templates.PromoCard.Fields.Image))"></figure>
</div>
<div class="card-content">
<div class="content">
<h4>@Html.Sitecore().Field(Templates.PromoCard.Fields.Headline)</h4>
@Html.Sitecore().Field(Templates.PromoCard.Fields.Text)
</div>
</div>
</div>
@Html.Sitecore().EndField()
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@using BasicCompany.Feature.BasicContent
@using BasicCompany.Foundation.FieldRendering

<div class="container">
<h2 class="title">@Html.Sitecore().Field(Templates.SectionHeader.Fields.Text.ToString())</h2>
<h2 class="title">@Html.Sitecore().Field(Templates.SectionHeader.Fields.Text)</h2>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@
<DependentUpon>web.config</DependentUpon>
</None>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<ProjectReference Include="..\..\..\Foundation\FieldRendering\website\BasicCompany.Foundation.FieldRendering.csproj">
<Project>{508c9659-2186-4655-b24a-f2de3744bab5}</Project>
<Name>BasicCompany.Foundation.FieldRendering</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
@model Sitecore.Data.Items.Item
@using BasicCompany.Feature.Navigation
@using BasicCompany.Foundation.FieldRendering

<footer class="footer footer-extended">
<div class="content container">
<p>@Html.Sitecore().Field(Templates.NavigationRoot.Fields.FooterCopyright.ToString(), Model) &copy; 2018-@DateTime.Now.Year</p>
<p>@Html.Sitecore().Field(Templates.NavigationRoot.Fields.FooterCopyright, Model) &copy; 2018-@DateTime.Now.Year</p>
</div>
</footer>
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
@model BasicCompany.Feature.Navigation.Models.Header
@using BasicCompany.Feature.Navigation
@using BasicCompany.Foundation.FieldRendering

<nav class="navbar is-black is-tab" role="navigation" aria-label="main navigation">
<div class="container">
<div class="navbar-brand">

<a class="navbar-item" href="@Model.HomeUrl">
@Html.Sitecore().Field(Templates.NavigationRoot.Fields.HeaderLogo.ToString(), Model.HomeItem)
@Html.Sitecore().Field(Templates.NavigationRoot.Fields.HeaderLogo, Model.HomeItem)
</a>

<a role="button" class="navbar-burger burger" aria-label="menu" aria-expanded="false"
data-target="navbarBasicExample">
data-target="navbarBasicExample">
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
Expand All @@ -22,7 +23,7 @@
@foreach (var navItem in Model.NavigationItems)
{
<a class="navbar-item is-tab @(navItem.IsActive ? "is-active" : "")" href="@navItem.Url">
@Html.Sitecore().Field(Templates.NavigationItem.Fields.NavigationTitle.ToString(), navItem.Item)
@Html.Sitecore().Field(Templates.NavigationItem.Fields.NavigationTitle, navItem.Item)
</a>
}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Controllers\ProductsController.cs" />
<Compile Include="Extensions\SitecoreHelperExtensions.cs" />
<Compile Include="ServicesConfigurator.cs" />
<Compile Include="Services\ProductSearchQuery.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
Expand All @@ -84,7 +83,12 @@
<DependentUpon>web.config</DependentUpon>
</None>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<ProjectReference Include="..\..\..\Foundation\FieldRendering\website\BasicCompany.Foundation.FieldRendering.csproj">
<Project>{508c9659-2186-4655-b24a-f2de3744bab5}</Project>
<Name>BasicCompany.Foundation.FieldRendering</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
@using BasicCompany.Feature.Products
@using BasicCompany.Foundation.FieldRendering

<div class="container">
<section class="hero is-small product-detail-hero">
<div class="hero-body">
<h1 class="title">
@Html.Sitecore().Field(Templates.Product.Fields.Title.ToString())
@Html.Sitecore().Field(Templates.Product.Fields.Title)
</h1>
<h2 class="subtitle is-one-quarter">
@Html.Sitecore().Field(Templates.Product.Fields.ShortDescription.ToString())
@Html.Sitecore().Field(Templates.Product.Fields.ShortDescription)
</h2>
</div>
</section>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
@using BasicCompany.Feature.Products
@using BasicCompany.Foundation.FieldRendering

<section class="product-detail columns is-centered is-vcentered">
<div class="product-details column is-narrow has-text-centered-mobile">
<h5>@Sitecore.Globalization.Translate.Text("Products-Detail-Price")</h5>
<p class="price">$@Html.Sitecore().Field(Templates.Product.Fields.Price.ToString())</p>
@Html.Sitecore().Field(Templates.Product.Fields.Features.ToString())
<p class="price">$@Html.Sitecore().Field(Templates.Product.Fields.Price)</p>
@Html.Sitecore().Field(Templates.Product.Fields.Features)
</div>
<div class="product-image column is-3">
@Html.Sitecore().Field(Templates.Product.Fields.Image.ToString())
@Html.Sitecore().Field(Templates.Product.Fields.Image)
</div>
</section>
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
@model IEnumerable<Sitecore.Data.Items.Item>
@using BasicCompany.Feature.Products;
@using BasicCompany.Feature.Products.Extensions;

<div class="container">
<div class="product-list-columns columns is-multiline">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@model RenderingModel
@using BasicCompany.Feature.Products
@using BasicCompany.Feature.Products.Extensions
@using Sitecore.Data.Fields;

@{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@model Sitecore.Data.Items.Item
@using BasicCompany.Feature.Products
@using BasicCompany.Feature.Products.Extensions;
@using BasicCompany.Foundation.FieldRendering

<a href="@Html.Sitecore().ItemUrl(Model)" class="column product-list-column is-4-desktop is-6-tablet">
<div class="card">
Expand All @@ -9,8 +9,8 @@
</div>
<div class="card-content">
<div class="content">
<h4>@Html.Sitecore().Field(Templates.Product.Fields.Title.ToString(), Model)</h4>
<p>@Html.Sitecore().Field(Templates.Product.Fields.ShortDescription.ToString(), Model)</p>
<h4>@Html.Sitecore().Field(Templates.Product.Fields.Title, Model)</h4>
<p>@Html.Sitecore().Field(Templates.Product.Fields.ShortDescription, Model)</p>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
<Content Include="App_Config\Include\Feature\Feature.Services.Serialization.config" />
</ItemGroup>
<ItemGroup>
<Compile Include="Extensions\SitecoreHelperExtensions.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Templates.cs" />
</ItemGroup>
Expand All @@ -72,7 +71,12 @@
<DependentUpon>web.config</DependentUpon>
</None>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<ProjectReference Include="..\..\..\Foundation\FieldRendering\website\BasicCompany.Foundation.FieldRendering.csproj">
<Project>{508c9659-2186-4655-b24a-f2de3744bab5}</Project>
<Name>BasicCompany.Foundation.FieldRendering</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
@model RenderingModel
@using BasicCompany.Feature.Services;
@using BasicCompany.Feature.Services.Extensions;
@using BasicCompany.Feature.Services;
@using BasicCompany.Foundation.FieldRendering

<div class="column testimonial is-6">
<div class="testimonial-inner" style="background-image: url(@Html.Sitecore().MediaUrl(Templates.Testimonial.Fields.Image))">
<h3>@Html.Sitecore().Field(Templates.Testimonial.Fields.Title.ToString())</h3>
@Html.Sitecore().Field(Templates.Testimonial.Fields.Quote.ToString())
<h3>@Html.Sitecore().Field(Templates.Testimonial.Fields.Title)</h3>
@Html.Sitecore().Field(Templates.Testimonial.Fields.Quote)
</div>
</div>
Loading

0 comments on commit 7df6b8e

Please sign in to comment.