HowTo build your own K2 Lorem Ipsum generator....

  • 22 April 2016
  • 0 replies
  • 2 views

Badge +10

As designers many times we find ourselves in a position to have to put data within our wireframes, concepts or even testing....

 

Many times the text generator Lorem Ipsum come to the rescue, however for the SEC Fans [ Roll Tide ] . many times we use something more apropiate for the south like Bacon Ipsum. and yes there are some other folks that rather like to keep it light and for they there is Tuna Ipsum.

 

Over the Internet there are some other Lorem generators. But I wanted to build my own one, and I wanted to build it with K2.

 

So here is one way to get it done.

 

Requirements:

 

a) Have the Ability to have multiple Categories of Ipsums.

b) Have many words that belong to each category

c) Build random parragraph sizes, using randome letters for that particular category.

 

SMO's

  Lorem Category

  Lorem Word

  K2 ForLoop

 

In SQL:

 

Lorem Category

  ID

  LoremCategory

 

This table will just basically the name of the Categry. Populate with as many as Lorems do you want.

 

 

Lorem Word

  ID

  LoremCategoryID

  LoremWord

 

For each particular category put the individual words to be used to pull data into your text parragraph.

 

K2ForLoop

  ID

  ForLoopID

 

This is very insteresting basically a list with 500 entries auto index and the name of the ID... will be used as loop tecnique within K2 [ Number of words in the parragraph ] mechanism to generate specific numer of random words trough the loop then append to your LoremIpsum parragraph.

NOTE:: This view will be filtered, by param_maxid which is a number, this way will not be loaded with data and is hiddend. later we calculate the number of words in the parragraph, and then we initialize the view passing the number of words, with this will return the number of words. then we use a for each loop method on this number and generate the random word and append to a global LoremIpsum variable.

 

 

 

11365i6D9DE570D2C41B56.jpg

 

This was pretty awesome can create multiple Categories, add the words and use it in WireFrames building Webapps.

 

I'm even thinking about to have some functions to generate random data to populate when testing some Forms.

 

Surely this was a fun Form to work on and show one more time how easily K2 can tackle some work, even with some trickery enabling some ForLoop SMO's controlled via the view and not exactly from Code or from the SMO directly.

 

Enjoy it !!!.

 

 


0 replies

Be the first to reply!

Reply