Search code examples
2sxc

Is there an Elegant way to use Razor Blade to add TagToolbar()?


Am I missing something obvious? In a 2sxc CSharp View, how can I get the HtmlString output of Edit.TagToolbar(item) in to a Tag using RazorBlade?

 @Tag.Div(item.Title).Attr(Edit.TagToolbar(item))   // is there a way to do this?

Solution

  • I'm pretty sure it will work. The docs kind of assume it does: https://razor-blade.net/api/ToSic.Razor.Markup.Tag-1.html#ToSic_Razor_Markup_Tag_1_Attr_System_Object_

    ...but you may need to ToString() it... try this

    @Tag.Div(item.Title).Attr(Edit.TagToolbar(item).ToString())
    

    If this was all that was missing, we'll probably see if we can enhance RazorBlade to make it unnecessary.