-
I want to override templates of BlogPost's category and tags but I can't reason how it works. To override an existing
However, this template does not work:
The questions are:
To override an existing
The questions are:
These templates do not work at all:
The questions is:
Thank you so much. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
Category and Tags in BlogPost are fields not parts, Let's deconsturct the template tokens to better understand BlogPost Category Tags
This works because it maps to
This doesn't work because it's doesnt match with the pattern
This works because for Detail it match with the pattern
If you want Tags to resolve template same as |
Beta Was this translation helpful? Give feedback.
-
@ns8482e Thank you so much for your prompt reply. I just only want to add some information that can be useful for others or reference.
As the following code:
As the following code: Get the list of alternate shapesIf we debug and watch a model object in |
Beta Was this translation helpful? Give feedback.
-
Using the mini-profiler feature is quite helpful sometimes to figure out which templates are rendered. Also to know which shapes are instanciated. |
Beta Was this translation helpful? Give feedback.
-
FYI if we create a custom theme, it need to have a layout zone "footer" to render Mini Profiler. @* Layout.csthml *@
<footer>
@await RenderSectionAsync("Footer", required: false)
</footer>
Example of Mini Profiler on a frontend. |
Beta Was this translation helpful? Give feedback.
Category and Tags in BlogPost are fields not parts,
Let's deconsturct the template tokens to better understand
BlogPost
[ContentType] is
BlogPost
[PartType] is
BlogPost
(implicit part for Category and Tags fields added to content type)[DisplayType] is
Detail
means it doesn't use[DisplayType]
is ignred in templatesCategory
[FieldName] is
Category
[FieldType] is
TaxonomyField
[ShapeType] is
TaxonomyField
[DisplayMode] is
Standard
means it doesn't useDisplayMode
templatesTags
[FieldName] is
Tags
[FieldType] is
TaxonomyField
[ShapeType] is
TaxonomyField
[DisplayMode] is
Tags
means usesDisplayMode
templates.This works because it maps to
[…