< back

Configure Storebuilder with new Umbraco Web Project

Step 1 - Create new empty Web Project.

Step 2- Add Umbraco Nuget packages.

Step 3 - Create SQL Database and update connection string.

NOTE: Umbraco considers the database unconfigured if their is no valid connection string. If you manually add the new connection string to the web.config within Visual Studio, Umbraco will not correctly run the Umbraco setup wizard when first launched.

NOTE: If you want to force umbraco to re-run the setup wizard, you must delete the connection string and any value from 'umbracoConfigurationStatus' configuration element. See https://our.umbraco.org/wiki/reference/webconfig/

Link to Umbraco Tutorial for setting up content types, etc.

Step 4 - Add StoreBuilder Nuget packages.

  • StoreBuilder
  • StoreBuilder.Log4net
  • StoreBuilder.Mvc
  • StoreBuilder.UmbracoConnector
  • StoreBuilder.Admin

Step 5 - Configure StoreBuilder to use Umbraco security provider for authentication

Add StoreBuilder section to your web project's web.config file.

Part A - Add configSection declaration:

<section name="storebuilder" type="StoreBuilder.Config, StoreBuilder" />

Part B - Add <storebuilder> configuration element.

<storefront><storebuilder>
  <database connectionStringName="Storefront" />
  <logProvider type="StoreBuilder.Log4Net.LogProvider, StoreBuilder.Log4Net" />
  <securityProvider type="StoreBuilder.UmbracoConnector.Security.UmbracoSecurityProvider, StoreBuilder.UmbracoConnector" />
  <license accountKey="25RD-V3QU-NA56-PGQY" licenseKey="AAAA-AQA5-CGL2-CZCR-3Y7W-V5ZW-UU2N-73FY-YHUO-TWZO-NRMP-SLXD-FOEU-LN7W-JJLZ-LC4S-BEPY-RXND" />
</storefront></storebuilder>

If you remove the logProvider configuration element, you will simply have no logging configured but StoreBuilder will run fine.

Step 6 - Add StoreBuilder namespaces to your Web.config for Razor views

Add the StoreBuilder namespace to the Web.config in your Views folder so that StoreBuilder HtmlHelper extension methods work properly in your Razor views.

<configuration>
  <system.web.webPages.razor>
    <pages pageBaseType="System.Web.Mvc.WebViewPage">
      <namespaces>
        <add namespace="StoreBuilder" />
      </namespaces>
    </pages>
  </system.web.webPages.razor>
</configuration>

Step 7 - Add a PageWrapper razor view

The StoreBuilder.Mvc nuget package contains an MVC StoreBuilderController which is used to integrate StoreBuilder functionality into a regular MVC project. While all StoreBuilder core features and plugins use Handlebars for templating, markup intended to be rendered as a page will be passed through this StoreBuilderController and wrapped with a surrounding Razor view in order to make site wide consistency easy for the MVC developer.

In your Views folder, add a new folder called 'StoreBuilder'. Then add a new Razor view in the StoreBuilder folder named 'PageWrapper.cshtml'.

As a minimum this template may appear as follows:

@model StoreBuilder.Content.Results.PageContentResult
@Html.Raw(Model.Body)
@section scripts{
    @Html.RenderScripts(Model.ThemeResourceArea)
}

Step 8 - Create a /themes folder for your StoreBuilder themes

StoreBuilder will be default look for a /themes folder in the root of your project to discover any StoreBuilder theme files. Each theme should be contained within a subfolder of the root /themes folder.

The default theme should be aptly named 'default' and contained within the /themes/default folder.

For more information see StoreBuilder ThemeEngine.

Step 9 - Secure the /storebuilder project path

If you installed the StoreBuilder.Admin nuget package, it will have added the StoreBuilder folder to your web project which contains an admin portal for StoreBuilder. All the API used by this admin portal will already be secured, however securing the admin portal files will add one more layer of protection to your website and prevent public review of your admin portal code or configuration.

<location path="storebuilder">
  <system.web>
    <authorization>
      <allow roles="StoreBuilder.Admin" />
      <deny users="*" />
    </authorization>
  </system.web>
</location>