DamianEdwards / TagHelperPack

A set of useful, and possibly opinionated, Tag Helpers for ASP.NET Core
MIT License
338 stars 58 forks source link

Add support for specifying a template name. #44

Closed haacked closed 2 years ago

haacked commented 2 years ago

The Display Template HTML helpers support specifying a template name that is used to override the default display/editor template for a given type.

This adds support for that to the display and editor tag helpers.

This PR only adds this to DisplayTagHelper and EditorTagHelper. If you like this change, I can also add support for DisplayForTagHelper and EditorForTagHelper. The only question there is what should the attribute name be for those tag helpers? template-name like it is for DisplayTagHelper or asp-template-name? I'm assuming the latter to be consistent.

DamianEdwards commented 2 years ago

Thanks for the PR! Would love for this to be added to the other tag helpers you mention too, with the naming you suggest. Bonus points if you update the sample/site page with an example of this in use 😁

haacked commented 2 years ago

No problem!

haacked commented 2 years ago

Ok, this is ready for review.