Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document the new ITagHelperComponent in ASP.NET Core 2.0 #4033

Closed
scottaddie opened this issue Aug 18, 2017 · 10 comments
Closed

Document the new ITagHelperComponent in ASP.NET Core 2.0 #4033

scottaddie opened this issue Aug 18, 2017 · 10 comments
Assignees
Labels

Comments

@scottaddie
Copy link
Member

scottaddie commented Aug 18, 2017

Work with Jass Bagga to get this new 2.0 scenario documented. See aspnet/Mvc#6282 for more info.

I propose the following outline for a new reference doc called Creating Custom Tag Helper Components:

  • Overview
  • Use Cases
  • Adding via Dependency Injection
  • Adding via Controllers
  • Adding via Views

This new doc will be found within the MVC --> Views --> Tag helpers TOC node, and a sample app similar to https://github.com/jbagga/VSLiveDemo/tree/master/src/TagHelperComponentSample will accompany it.

@scottaddie scottaddie self-assigned this Aug 18, 2017
@Rick-Anderson Rick-Anderson added this to the Backlog milestone Aug 23, 2017
@scottaddie
Copy link
Member Author

@danroth27 @jbagga @NTaylorMullen Looking for your feedback on the doc title and outline provided above.

@Rick-Anderson Rick-Anderson added Pri1 and removed Pri2 labels Aug 24, 2017
@jbagga
Copy link
Contributor

jbagga commented Aug 25, 2017

Title recommendation: Modifying <head> or <body> HTML tags with TagHelperComponents (or something similar)
If there is a subsection, explaining how to modify/target other HTML tags by writing your own TagHelperComponentTagHelper implementation, then that can be titled:
Modifying other HTML tags

cc @NTaylorMullen

@NTaylorMullen
Copy link
Contributor

I'd probably have a specific section labeled: Including JavaScript and CSS in your views using TagHelperComponents.

This will be the typical use-case from users. Having other pieces that go into detail on the components would also be required.

@mguinness
Copy link

@NTaylorMullen Are TagHelper components usable from within partial views as well? If so, that would be a good example to include. As sections don't work in partial views, this would be a useful alternative that is often requested.

@NTaylorMullen
Copy link
Contributor

@NTaylorMullen Are TagHelper components usable from within partial views as well?

They are 😄

As sections don't work in partial views, this would be a useful alternative

It wouldn't be super straight forward to use TagHelperComponent's in partials (since they apply to every view) but it's definitely doable. I'm not sure if it's worth noting in the doc due to its complexity.

@mguinness
Copy link

Thanks! I'm sure they'll be used in partial views for things like widgets even if it's a bit of work, but since it's an edge case it makes sense to omit from doc.

@Rick-Anderson
Copy link
Contributor

@NTaylorMullen if you can write a sample app for this I'll get the doc scheduled in the next sprint.

@jbagga
Copy link
Contributor

jbagga commented Nov 21, 2017

@Rick-Anderson I have a basic sample here which I can clean up

@jbagga
Copy link
Contributor

jbagga commented Nov 29, 2017

Here is the cleaned up sample https://github.com/jbagga/TagHelperComponentSample. Feel free to modify to create a more realistic example.

Let me know if I can clarify anything or look at the doc.

@guardrex
Copy link
Collaborator

Cross-ref @DamianEdwards presenting: https://youtu.be/Blo--Qio84w?t=56m51s

@guardrex guardrex mentioned this issue Mar 25, 2018
10 tasks
@guardrex guardrex changed the title Document the new ITagHelperComponent feature in ASP.NET Core 2.0 Document the new ITagHelperComponent in ASP.NET Core 2.0 Apr 19, 2018
@guardrex guardrex removed their assignment May 18, 2018
@scottaddie scottaddie modified the milestones: Sprint 140 (8/13 to 8/31), Sprint 141 (9/3 to 9/21) Sep 6, 2018
scottaddie added a commit that referenced this issue Sep 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants