public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) { var heading = context.AllAttributes["heading"].Value; var image = context.AllAttributes["image"].Value; var name = context.AllAttributes["name"].Value; var subtitle = context.AllAttributes["subtitle"].Value; var link = context.AllAttributes["link"].Value; var content = await output.GetChildContentAsync(); var encodedeContent = content.GetContent(); output.Attributes.RemoveAll("heading"); output.Attributes.RemoveAll("image"); output.Attributes.RemoveAll("name"); output.Attributes.RemoveAll("subtitle"); output.Attributes.RemoveAll("link"); var outputHtml = string.Format(Template, heading, image, name, subtitle, encodedeContent, link); output.Content.SetHtmlContent(new HtmlString(outputHtml)); output.TagName = TagName; await HtmlAttributes.UpdateClassesToInclude(output, "profile profile-success-story"); }
public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) { if (context.AllAttributes.ContainsName("as-link")) { output.TagName = "a"; output.Attributes.RemoveAll("as-link"); } else { output.TagName = "button"; } await HtmlAttributes.UpdateClassesToInclude(output, "button-default"); }
public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) { output.TagName = "button"; await HtmlAttributes.UpdateClassesToInclude(output, "button-default button-loading"); }