Skip to content

Commit

Permalink
Documentation has been updated according to issue #19
Browse files Browse the repository at this point in the history
  • Loading branch information
NaibafCH committed Sep 4, 2017
1 parent 2d4caf3 commit 170353d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 11 deletions.
4 changes: 2 additions & 2 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Please see the [getting started guide of NitroNet](https://github.com/namics/Nit

### Create a Layout in Sitecore

Create a layout item below `/sitecore/layout/Layouts` and set the `Path` field relative to path you configured in the setting `NitroNet.BasePath`. Please make sure that you set the file name without the file extension.
Create a layout item below `/sitecore/layout/Layouts` and set the `Path` field relative to the path you configured in the setting `NitroNet.BasePath`. Please make sure that you set the file name without the file extension.

*Important:* It is currently only possible to use `.html` files as layouts.
*Important:* The path must not have a leading slash.

#### Example
Assumption:
Expand Down
38 changes: 29 additions & 9 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,41 @@ Optionally, we recommend to install the [Unity.Mvc](https://www.nuget.org/packag
`PM >` `Install-Package NitroNet.Sitecore.CastleWindsorModules.Sitecore82`


##### Extend your Global.asax(.cs)
To activate NitroNet for Sitecore it's important to add/register the new view engine in your application. You can do this, with these lines of code ([Gist](https://gist.github.com/hombreDelPez/e5ad065572fdab7145dd72847d8aabd2)):
##### Register the view engine

To activate NitroNet for Sitecore it's important to add/register the new view engine in your application. Create a Sitecore pipeline processor and add it at the end of the initialize pipeline:

**Processor**

```csharp
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
using System.Web.Mvc;
using NitroNet.Sitecore;
using Sitecore.Pipelines;

ViewEngines.Engines.Add(DependencyResolver.Current.GetService<SitecoreNitroNetViewEngine>());
public class RegisterNitroNetViewEngine
{
public virtual void Process(PipelineArgs args)
{
ViewEngines.Engines.Add(DependencyResolver.Current.GetService<SitecoreNitroNetViewEngine>());
}
}
```

**Config**

```xml
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<pipelines>
<initialize>
<processor type="MyApplication.RegisterNitroNetViewEngine, MyApplication" />
</initialize>
</pipelines>
</sitecore>
</configuration>
```

##### Register the IoC containers

###### Microsoft.DependencyInjection
Expand Down

0 comments on commit 170353d

Please sign in to comment.