Skip to content

Commit

Permalink
docs(README): add usings sample code, name project 'Xperience Page Li…
Browse files Browse the repository at this point in the history
…nks'
  • Loading branch information
seangwright committed Oct 10, 2022
1 parent cb7b9e0 commit c2ea6a6
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Xperience Page Link Tag Helpers
# Xperience Page Links

[![GitHub Actions CI: Build](https://github.com/wiredviews/xperience-page-link-tag-helpers/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/wiredviews/xperience-page-link-tag-helpers/actions/workflows/ci.yml)

Expand Down Expand Up @@ -34,6 +34,10 @@ This package is compatible with ASP.NET Core 3.1+ applications or libraries inte

> Populate the `Guid` values with the `NodeGUID` of each page in the content tree that you need to link to in your application.

```csharp
using XperienceCommunity.LinkablePages;
```

```csharp
public namespace Sandbox.Shared
{
Expand Down Expand Up @@ -61,6 +65,10 @@ This package is compatible with ASP.NET Core 3.1+ applications or libraries inte

1. In the shared class library, create an implementation of the `ILinkablePageInventory` interface, which will be used to determine which Pages in the application should be protected:

```csharp
using XperienceCommunity.LinkablePages;
```

```csharp
public class LinkablePageInventory : ILinkablePageInventory
{
Expand Down Expand Up @@ -96,6 +104,10 @@ This package is compatible with ASP.NET Core 3.1+ applications or libraries inte
1. Register the library with ASP.NET Core DI:
```csharp
using XperienceCommunity.LinkablePages;
```
```csharp
public void ConfigureServices(IServiceCollection services)
{
Expand All @@ -114,6 +126,8 @@ This package is compatible with ASP.NET Core 3.1+ applications or libraries inte
1. Add the data protection custom module registration to your ASP.NET Core application (in `Startup.cs` or wherever you register your dependencies):
```csharp
using XperienceCommunity.LinkablePages;
[assembly: RegisterModule(typeof(LinkablePageProtectionModule))]
```
Expand All @@ -130,6 +144,10 @@ This package is compatible with ASP.NET Core 3.1+ applications or libraries inte
1. Create a custom module class in your CMS application to register the `LinkablePageProtectionModule` and the `ILinkablePageInventory` implementation:
```csharp
using XperienceCommunity.LinkablePages;
```
```csharp
// Registers this custom module class
[assembly: RegisterModule(typeof(DependencyRegistrationModule))]
Expand Down

0 comments on commit c2ea6a6

Please sign in to comment.