<commit_before>Alternates are optional variations of a shape that you can implement in a theme in order to customize
the rendering of the shape for specific cases.
By using alternates, you can override which template is used to render content,
based on the type (or other characteristic) of that content.
For example, you can use alternates to apply one layout file for the home page but another layout file for subpages.
Or you can use alternates to render tags one way when the tags are in a page but
a different way when the tags are in a blog post.
Alternates are particularly useful when you have different types of content and
you want to customize the appearance of these different types of content. 

The Orchard framework uses a naming convention to determine whether an alternate template
is used for rendering content.
The naming convention enables you to add template files that are used automatically,
without requiring you to modify any code.


## Naming Convention for Alternates

Alternate shapes are named using the name of the base shape followed by a double underscore \(\_\_\)
and an ending that is specific to the alternate shape.
For example, a `Parts_Tags_ShowTags` shape can have alternates with names such as
`Parts_Tags_ShowTags__BlogPost` and `Parts_Tags_ShowTags__Page`.
The part of the alternate name after the double underscore reflects when the shape is used,
such as the current content type. (For more information about how shapes are named,
see [Accessing and Rendering Shapes](Accessing-and-rendering-shapes).)

## Mapping a Template File to an Alternate

To create a template file that maps to the corresponding shape name,
you must name the template according to the  following naming convention:

* Convert an underscore (_) in the shape name to either a dot (.) or backslash (\) in the template name.
A backslash indicates that the template resides in a subfolder.
* Convert a double underscore \(\_\_\) in the shape name to a hyphen (-).
* For any Display type value in the shape name, place the type name after a dot (.)
at the end of the template name, such as Content-BlogPost.Summary.

All templates for alternates must reside in the _Views_ folder.
The _Views_ folder can be located either in the theme or in the module.
The following table shows which subfolders of _Views_ to use for different types of templates.

Shape type     | Template Folder
-------------- | ----------------<commit_msg>Added blackslash to Alternative markdown.<commit_after>Alternates are optional variations of a shape that you can implement in a theme in order to customize
the rendering of the shape for specific cases.
By using alternates, you can override which template is used to render content,
based on the type (or other characteristic) of that content.
For example, you can use alternates to apply one layout file for the home page but another layout file for subpages.
Or you can use alternates to render tags one way when the tags are in a page but
a different way when the tags are in a blog post.
Alternates are particularly useful when you have different types of content and
you want to customize the appearance of these different types of content. 

The Orchard framework uses a naming convention to determine whether an alternate template
is used for rendering content.
The naming convention enables you to add template files that are used automatically,
without requiring you to modify any code.


## Naming Convention for Alternates

Alternate shapes are named using the name of the base shape followed by a double underscore \(\_\_\)
and an ending that is specific to the alternate shape.
For example, a `Parts_Tags_ShowTags` shape can have alternates with names such as
`Parts_Tags_ShowTags__BlogPost` and `Parts_Tags_ShowTags__Page`.
The part of the alternate name after the double underscore reflects when the shape is used,
such as the current content type. (For more information about how shapes are named,
see [Accessing and Rendering Shapes](Accessing-and-rendering-shapes).)

## Mapping a Template File to an Alternate

To create a template file that maps to the corresponding shape name,
you must name the template according to the  following naming convention:

* Convert an underscore (_) in the shape name to either a dot (.) or backslash (\\) in the template name.
A backslash indicates that the template resides in a subfolder.
* Convert a double underscore \(\_\_\) in the shape name to a hyphen (-).
* For any Display type value in the shape name, place the type name after a dot (.)
at the end of the template name, such as Content-BlogPost.Summary.

All templates for alternates must reside in the _Views_ folder.
The _Views_ folder can be located either in the theme or in the module.
The following table shows which subfolders of _Views_ to use for different types of templates.

Shape type     | Template Folder
-------------- | ----------------
{'fraction_non_alphanumeric': 0.047667549399062946, 'fraction_numerical': 0.0, 'mean_word_length': 4.152151101783841, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7369882', 'n_tokens_mistral': 1173, 'n_tokens_neox': 1137, 'n_words': 760}