Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 1 addition & 59 deletions 13/umbraco-commerce/how-to-guides/customizing-templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,62 +14,4 @@ Download the custom templates and place them in `/Views/Partials/Commerce/Email/

{% file src="../.gitbook/assets/Umbraco.Commerce.Templates.v13.zip" %}
Umbraco Commerce Custom Templates
{% endfile %}

## Creating Custom Templates

### Email Templates

To Create a Custom Email Template:

1. Create a Razor view file (`.cshtml`) in `/Views/Partials/Commerce/Email/.`
2. Implement the `IEmailTemplate` interface to make the template available in Umbraco Commerce:

```csharp
using Umbraco.Commerce.Core.Interfaces;

public class CustomOrderEmailTemplate : IEmailTemplate
{
public virtual string FileName => "CustomOrderEmail.cshtml";
}

```

3. Register the Template in a Composer:

```csharp
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.DependencyInjection;

public class CustomTemplateComposer : IComposer
{
public void Compose(IUmbracoBuilder builder)
{
builder.EmailTemplates().Add<CustomOrderEmailTemplate>();
}
}

```

### Print and Export Templates

To create Print/Export Templates:

1. Create a Razor view file (`.cshtml`) under the relevant paths:

```
/Views/Partials/Commerce/Prints/
/Views/Partials/Commerce/Exports/
```

2. Implement the `IPrintTemplate` or `IExportTemplate` interface to make the template available in Umbraco Commerce.
3. Register the template in a Composer similar to the email template process.

## Shipping Custom Templates in a Razor Class Library

To distribute custom templates as part of a Razor Class Library (RCL):

1. Create a new Razor Class Library project.
2. Add the template files under appropriate paths, for example, `Views/Partials/Commerce/Emails/`.
3. Implement interfaces like `IEmailTemplate,` `IPrintTemplate,`or `IExportTemplate` .
4. Use a composer to register your custom templates.
{% endfile %}
57 changes: 0 additions & 57 deletions 15/umbraco-commerce/how-to-guides/customizing-templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,60 +16,3 @@ Download the custom templates and place them in `/Views/Partials/Commerce/Email/
Umbraco Commerce Custom Templates
{% endfile %}

## Creating Custom Templates

### Email Templates

To Create a Custom Email Template:

1. Create a Razor view file (`.cshtml`) in `/Views/Partials/Commerce/Email/.`
2. Implement the `IEmailTemplate` interface to make the template available in Umbraco Commerce:

```csharp
using Umbraco.Commerce.Core.Interfaces;

public class CustomOrderEmailTemplate : IEmailTemplate
{
public virtual string FileName => "CustomOrderEmail.cshtml";
}

```

3. Register the Template in a Composer:

```csharp
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.DependencyInjection;

public class CustomTemplateComposer : IComposer
{
public void Compose(IUmbracoBuilder builder)
{
builder.EmailTemplates().Add<CustomOrderEmailTemplate>();
}
}

```

### Print and Export Templates

To create Print/Export Templates:

1. Create a Razor view file (`.cshtml`) under the relevant paths:

```
/Views/Partials/Commerce/Prints/
/Views/Partials/Commerce/Exports/
```

2. Implement the `IPrintTemplate` or `IExportTemplate` interface to make the template available in Umbraco Commerce.
3. Register the template in a Composer similar to the email template process.

## Shipping Custom Templates in a Razor Class Library

To distribute custom templates as part of a Razor Class Library (RCL):

1. Create a new Razor Class Library project.
2. Add the template files under appropriate paths, for example, `Views/Partials/Commerce/Emails/`.
3. Implement interfaces like `IEmailTemplate,` `IPrintTemplate,`or `IExportTemplate` .
4. Use a composer to register your custom templates.
57 changes: 0 additions & 57 deletions 16/umbraco-commerce/how-to-guides/customizing-templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,60 +16,3 @@ Download the custom templates and place them in `/Views/Partials/Commerce/Email/
Umbraco Commerce Custom Templates
{% endfile %}

## Creating Custom Templates

### Email Templates

To Create a Custom Email Template:

1. Create a Razor view file (`.cshtml`) in `/Views/Partials/Commerce/Email/.`
2. Implement the `IEmailTemplate` interface to make the template available in Umbraco Commerce:

```csharp
using Umbraco.Commerce.Core.Interfaces;

public class CustomOrderEmailTemplate : IEmailTemplate
{
public virtual string FileName => "CustomOrderEmail.cshtml";
}

```

3. Register the Template in a Composer:

```csharp
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.DependencyInjection;

public class CustomTemplateComposer : IComposer
{
public void Compose(IUmbracoBuilder builder)
{
builder.EmailTemplates().Add<CustomOrderEmailTemplate>();
}
}

```

### Print and Export Templates

To create Print/Export Templates:

1. Create a Razor view file (`.cshtml`) under the relevant paths:

```
/Views/Partials/Commerce/Prints/
/Views/Partials/Commerce/Exports/
```

2. Implement the `IPrintTemplate` or `IExportTemplate` interface to make the template available in Umbraco Commerce.
3. Register the template in a Composer similar to the email template process.

## Shipping Custom Templates in a Razor Class Library

To distribute custom templates as part of a Razor Class Library (RCL):

1. Create a new Razor Class Library project.
2. Add the template files under appropriate paths, for example, `Views/Partials/Commerce/Emails/`.
3. Implement interfaces like `IEmailTemplate,` `IPrintTemplate,`or `IExportTemplate` .
4. Use a composer to register your custom templates.