Tool for helping creating lorem ipsum content
Have you been developing a new site and when it's time to demo the result for the customer the content isn't quite at the desired level? Should be easy enough to be disciplined and create proper demo content as you go along right? But still it's soo hard.
To make it easier I have created a small "tool/feature" which allows the editor to use simple commands in string, longstring and xhmlstring properties which get replaced by lorem ipsum content.
The idea came from our frontend team and I really liked it and decided to do something similiar for EPiServer.
The tool is implemented as a class implementing the IValidate inteface for the ContentData type and works for pages, blocks and media.
String and longstring
For string and longstring properties the command looks like this: #>10. #> is the actual command and 10 is the number of words that will randomly be seleccted from a predifined list.
Xhtmlstring
To avoid any advanced string parsing the rule to get a command to work is that it must be in a p tag and be the only thing in that paragraph. P tags containing any other content created in the editor is just left as it is, so you can combine the tool with any other content that you can create in the editor.
The general syntax looks like this: #>p>25. #> #> is to identify a command, next is the htmltag and after the last > char is the number of words. So in this example we will get a paragraph tag with 25 randomized words.
You can use whatever html element you want. And as an additon I addes som special tags to render both ul and ol lists which can contain text or links.
These are: ollinks,oltext, ullinks and ultext. To use them the command syntax is like this: #>ollinks>4>3. #>tag>number of li's in list>number of randomized words in each li.
The words the tool chooses from is hardoceded in the tool itself. It supports globalization and I've added words for english, swedish and as default lorem ipsum words.
I've made the code available over at GitHub.
Example images
String and longstring



Xhtmlstring



Comments