This is the main namespace you will be working with. Add it to your page like this:
After that you can simply use the commands - so here's a super simple cshtml file:
@using ToSic.Razor.Blade; <div> @Text.Ellipsis("this text is much too long & will need to be truncated", 25) </div>
Access the surrounding page and read/modify some properties, and add various kinds of headers to the <head> of the current page.
Helper to quickly generate all HTML5 tags with a Tag.Img() or Tag.Table() syntax.
This is the easiest and safest way to use in in Razor templates because you won't have naming issues etc.
The objects are smart - for example this will automatically uri-encode 😎
Important: Tag can easily be confused with the Tags object.
new in 3.0
The Tags-API is for manipulating strings which contain html or should contain html
- like stripping away tags, converting
<br>tags to new-lines and similar.
Important: Tags can easily be confused with the Tag object.
Many simple commands to work with Text / Strings
IScrub helps wash/clean html from things you want removed. It can take care of all tags, just specific tags or certain attributes.
Note that it is implemented as an interface, so you must use Dependency Injection to get it.