Products

Solutions

Learn More

Partners

Community

Blog

About

The Community Blog is a personal opinion of community members and by no means the official standpoint of DNN Corp or DNN Platform. This is a place to express personal thoughts about DNNPlatform, the community and its ecosystem. Do you have useful information that you would like to share with the DNN Community in a featured article or blog? If so, please contact .

The use of the Community Blog is covered by our Community Blog Guidelines - please read before commenting or posting.


Introducing Connect Razor Blade 1.0

Do you want to strip away HTML in a string, convert BRs to NewLines and back, truncate it without stopping in the middle of an & or ä? This and more is what Razor Blade is for. 

A Library for Typical Tasks

Razor Blade is a new c# library solving many trivial but common tasks in Razor Templates. The v1 release contains commands to...

  1. HTML / Tags tasks (detailed docs)
    1. Tags.Br2Nl(text)
    2. Tags.Br2Space(text)
    3. Tags.Nl2Br(text)
    4. Tags.Strip(text)
  2. Text tasks (detailed docs)
    1. Text.Crop(string, length)
    2. Text.Ellipsis(value, length)
    3. Text.Has(value)
    4. Text.First(value, value[, moreValues, ...])
    5. Text.Zip(value)

These helper commands will make your templates easier to read and bullet proof, because you won't re-invent how-to-strip-html in each template. 

Note that we really wanted this to be bullet-proof, so Razor Blade contains 30+ automated tests to verify edge cases, and we'll add more if any surprise still pop up. 

For C#, DNN and .net Core

We built the library as a cross-platform library, so you can use it in any kind of project and also be sure that once DNN moves to .net core, Razor Blade will move with it. 

Tutorials, Blogs and Documentation

To help you get started, we created all the basics you need

  1. Github Repo containing Razor Blade and the documentation
  2. DNN Install package in the releases
  3. Tutorial App showing code for all the commands - source in Github
  4. Blogs for using this are still WIP, but will be published soon

Note that you can easily install Razor Blade on any DNN or include it with your own DNN modules. 2sxc 9.40 will also include Razor Blade by default, so any Apps you develop for 2sxc 9.40+ will be able to use the features of Razor Blade 1.0.

Future Enhancements

We're currently working on future enhancements, which will cover common challenges like

  1. Read / Write the page title and metadata from your scripts
  2. Generate e-mails using Razor e-mail templates

Love from Switzerland,
iJungleboy


Daniel Mettler grew up in the jungles of Indonesia and is founder and CEO of 2sic internet solutions in Switzerland and Liechtenstein, an 20-head web specialist with over 800 DNN projects since 1999. He is also chief architect of 2sxc (see github), an open source module for creating attractive content and DNN Apps.



Read more posts by Daniel Mettler

Comments

There are currently no comments, be the first to post one.

Comment Form

Only registered users may post comments.

NewsArchives


Aderson Oliveira (22)
Alec Whittington (11)
Alessandra Davies (3)
Alex Shirley (10)
Andrew Hoefling (3)
Andrew Nurse (30)
Andy Tryba (1)
Anthony Glenwright (5)
Antonio Chagoury (28)
Ash Prasad (37)
Ben Schmidt (1)
Benjamin Hermann (25)
Benoit Sarton (9)
Beth Firebaugh (12)
Bill Walker (36)
Bob Kruger (5)
Bogdan Litescu (1)
Brian Dukes (2)
Brice Snow (1)
Bruce Chapman (20)
Bryan Andrews (1)
cathal connolly (55)
Charles Nurse (163)
Chris Hammond (213)
Chris Paterra (55)
Clint Patterson (105)
Cuong Dang (21)
Daniel Bartholomew (2)
Daniel Mettler (172)
Daniel Valadas (33)
Dave Buckner (2)
David Poindexter (12)
David Rodriguez (3)
Dennis Shiao (1)
Doug Howell (11)
Erik van Ballegoij (30)
Ernst Peter Tamminga (80)
Francisco Perez Andres (14)
Geoff Barlow (12)
George Alatrash (12)
Gifford Watkins (3)
Gilles Le Pigocher (3)
Ian Robinson (7)
Israel Martinez (17)
Jan Blomquist (2)
Jan Jonas (3)
Jaspreet Bhatia (1)
Jenni Merrifield (6)
Joe Brinkman (274)
John Mitchell (1)
Jon Henning (14)
Jonathan Sheely (4)
Jordan Coopersmith (1)
Joseph Craig (2)
Kan Ma (1)
Keivan Beigi (3)
Kelly Ford (3)
Ken Grierson (10)
Kevin Schreiner (6)
Leigh Pointer (31)
Lorraine Young (60)
Malik Khan (1)
Matt Rutledge (2)
Matthias Schlomann (16)
Mauricio Márquez (5)
Michael Doxsey (7)
Michael Tobisch (3)
Michael Washington (202)
Miguel Gatmaytan (3)
Mike Horton (19)
Mitchel Sellers (36)
Nathan Rover (3)
Navin V Nagiah (14)
Néstor Sánchez (31)
Nik Kalyani (14)
Oliver Hine (1)
Patrick Ryan (1)
Peter Donker (54)
Philip Beadle (135)
Philipp Becker (4)
Richard Dumas (22)
Robert J Collins (5)
Roger Selwyn (8)
Ruben Lopez (1)
Ryan Martinez (1)
Sacha Trauwaen (1)
Salar Golestanian (4)
Sanjay Mehrotra (9)
Scott McCulloch (1)
Scott S (11)
Scott Wilkinson (3)
Scott Willhite (97)
Sebastian Leupold (80)
Shaun Walker (237)
Shawn Mehaffie (17)
Stefan Cullmann (12)
Stefan Kamphuis (12)
Steve Fabian (31)
Steven Fisher (1)
Timo Breumelhof (24)
Tony Henrich (3)
Torsten Weggen (3)
Tycho de Waard (4)
Vicenç Masanas (27)
Vincent Nguyen (3)
Vitaly Kozadayev (6)
Will Morgenweck (40)
Will Strohl (173)
William Severance (5)

Content Layout

Subscribe to DNN Digest

Subscribe to DNN Digest

DNN Digest is our monthly email newsletter. It highlights news and content from around the DNN ecosystem, such as new modules and themes, messages from leadership, blog posts and notable tweets. Keep your finger on the pulse of the ecosystem by subscribing.  

What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out