Skip to content

Commit

Permalink
adding documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
giannik committed Oct 9, 2024
1 parent a91cb80 commit d93d2c8
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
36 changes: 36 additions & 0 deletions src/docs/reference/modules/Templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,42 @@ This template is called when a widget is rendered on a page.
| `Model.ContentItem.Content` | A JSON object containing all the data of the content item. |
| `Model.Classes` | An array of all the classes attached to the widget. |

### `Widget__Alias__[Alias]`

This template is called when displaying a widget content item with a specific alias. It needs to have the `AliasPart` attached to it.

#### Widget with Alias Examples

| Template | Filename |
|----------------------------|--------------------------------|
| `Widget__Alias__example` | `Widget-Alias-example.cshtml` |
| `Widget__Alias__my__page` | `Widget-Alias-my-page.cshtml` |

#### Widget with Alias and Display Type Examples

| Template | Filename |
|------------------------------------|----------------------------------------|
| `Widget_Summary__Alias__example` | `Widget-Alias-example.Summary.cshtml` |
| `Widget_Summary__Alias__my__page` | `Widget-Alias-my-page.Summary.cshtml` |

### `Widget__Slug__[Slug]`

This template is called when displaying a widget content item with a specific slug (i.e., a path is assigned to the item). It needs to have the `AutoroutePart` attached to it.

#### Widget with Slug Examples

| Template | Filename |
|---------------------------------|------------------------------------|
| `Widget__Slug__example` | `Widget-Slug-example.cshtml` |
| `Widget__Slug__blog__my__post` | `Widget-Slug-blog-my-post.cshtml` |

#### Widget with Slug and Display Type Examples

| Template | Filename |
|-----------------------------------|----------------------------------------|
| `Widget_Summary__Slug__example` | `Widget-Slug-example.Summary.cshtml` |
| `Widget_Summary__Slug__blog__my__post` | `Widget-Slug-blog-my-post.Summary.cshtml` |

## Content Part templates

Each driver is free to return a shape type of its choosing, but the usage is
Expand Down
4 changes: 2 additions & 2 deletions src/docs/releases/2.1.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,6 @@ A new feature was added to allow you to send SMS messages using Azure Communicat

The new **External Authentication** feature contains common functionality used by multiple external (i.e. non-local) authentication providers (like Microsoft or Google login). See [above](#external-authentication-logic-has-been-separated-from-the-users-feature) for details.

### Content Item Shape Alternates Based on Alias and Slug
### Content Item Shape Alternates Based on Alias and Slug (Content and Widget shapes)

Content item shapes can be overridden by their alias if `AliasPart` is attached or by their slug if `AutoroutePart` is attached. For examples, refer to the [docs](../reference/modules/Templates/README.md).
Content item shapes (Content and Widget local zones) can be overridden by their alias if `AliasPart` is attached or by their slug if `AutoroutePart` is attached. For examples, refer to the [docs](../reference/modules/Templates/README.md).

0 comments on commit d93d2c8

Please sign in to comment.