Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
brianhdk committed Oct 30, 2022
2 parents 8632a2e + 918bade commit 37e43be
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,26 @@ Run this command from the NuGet Package Manager Console to install the NuGet pac

### Using Relewise.Integrations.Umbraco

Add Relewise to the UmbracoBuilder, and specify the ContentTypes, that you would like exported into Relewise for content search and recommendation.
In this example, we are exporting all LandingPages and ContentPages to Relewise.
Open `Startup.cs` and add Relewise to the `IServiceCollection`-instance:

```csharp
services.AddRelewise(options => options.ReadFromConfiguration(_config));
```

... where the above configuration, requires Relewise configuration in `appsettings.json`:

```json
"Relewise": {
"DatasetId": "insert-dataset-id-here",
"ApiKey": "insert-api-key-here"
}
```

Find more details about this here: https://github.com/Relewise/relewise-sdk-csharp-extensions

To integrate with Umbraco, you need to add Relewise to the UmbracoBuilder (`.AddUmbraco(...)`), and optionally specify which ContentTypes, that you would like exported into Relewise for content search and recommendations.

In the example below we are exporting four content types into Relewise:
```csharp
services.AddUmbraco(_env, _config)
.AddRelewise(options => options
Expand All @@ -21,6 +39,15 @@ services.AddUmbraco(_env, _config)
.AddContentType("blogEntry", contentType => contentType.AutoMap()))
```

If you'd also like these content types to be automatically tracked, you can add our middleware to the UmbracoBuilder (`.UseUmbraco(...)`):
```csharp
app.UseUmbraco()
.WithMiddleware(u =>
{
u.TrackContentViews();
});
```

### Sample site - Get it up and running.

The sample site requires .NET 6 and NPM. There is a sample site for both Umbraco v9 and Umbraco v10.
Expand Down Expand Up @@ -49,6 +76,10 @@ The sample site has demo content, so once it's up and running, you can have a lo

Find more information on the Umbraco Marketplace: https://umbraco.com/marketplace/relewise/

Documentation can be found at https://docs.relewise.com.

**Please don't hesitate to reach out to us - www.relewise.com - if you'd like to know more, including how to gain access to our API.**

## Contributing

Pull requests are always welcome.
Expand Down

0 comments on commit 37e43be

Please sign in to comment.