You are here: System » LoremIpsumPlugin

LoremIpsumPlugin

Lorem ipsum generator

Description

This plugin allows you to generate dummy text and images of various kinds. There are a couple of text collections from which to pull out random fragments such as:

  • classic
  • buzzwords
  • cicero
  • client
  • office
  • pulpfiction

Additional corpoa may be added to the loremipsum template.

In addition, this plugin allows to have placeholder images as well using the unsplash image service. See the examples below.

What is Lorem Ipsum

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

Usage

%LOREM{<params>}%

Parameter Description Default
type output type. possible values are:
  • word: a single random word
  • words: a list of num words
  • headline: a list of words with at least min and at at most max words, upper-caseing the first word
  • sentence: a random sentence
  • sentences: a list of num sentences
  • paragraph: a list of min to max sentences
  • paragraphs: a list of num paragraphs
  • image: generates an <img ...> tag using https://source.unsplash.com
paragraph
corpus name of word list as defined in the loremipsum template; known default corpus are: buzzwords, cicero, classic, client kafka, office, pulpfiction classic
num number of items; applies to words, sentences, paragraphs 3
min minimum number of items to be selected; applies to headline, sentences, paragraph headline: 3, sentences: 4, paragraph 5
max maximum number of items to be selected randomly; applies to headline, sentences, paragraph headline: 7, sentences: 9, paragraph 10
width image width 240
height image height 160
style local css styles for the <img ...> tag  
search comma separated search terms for the kind of image to return  
class css class loremImage
align alignment of image, can be left, right, center  
alt alt attribute of image category and geometry of image
title title attribute of image alt

Examples

Corpus

Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. At vero eos et accusam et justo duo dolores et ea rebum. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

Images

random nature people city fruits water

%STARTSECTION{"examples"}% 
%JQREQUIRE{"loader"}%
<form id="loremForm" action="%SCRIPTURLPATH{"view"}%/%WEB%/%TOPIC%#Examples">

---+++ Corpus 
<select name="corpus" class="foswikiSelect reload">
<option %IF{"$'URLPARAM{corpus}'='classic'" then="selected"}%>classic</option>
<option %IF{"$'URLPARAM{corpus}'='buzzwords'" then="selected"}%>buzzwords</option>
<option %IF{"$'URLPARAM{corpus}'='cicero'" then="selected"}%>cicero</option>
<option %IF{"$'URLPARAM{corpus}'='client'" then="selected"}%>client</option>
<option %IF{"$'URLPARAM{corpus}'='kafka'" then="selected"}%>kafka</option>
<option %IF{"$'URLPARAM{corpus}'='office'" then="selected"}%>office</option>
<option %IF{"$'URLPARAM{corpus}'='pulpfiction'" then="selected"}%>pulpfiction</option>
</select>
<script>jQuery(function($) {
   $(".reload").on("click", function() {
      $(".myloader1").trigger('refresh', {
         'corpus': this.value
      });
      return false;
   });
});
</script>

<div class="jqLoader myloader1" data-section="lorem" data-placeholder="">
%STARTSECTION{"lorem"}%%LOREM{type="paragraph" corpus="%URLPARAM{"corpus" default="classic"}%"}%%ENDSECTION{"lorem"}%
</div>

---+++ Images
%LOREM{type="image" class="foswikiLeft"}%
%LOREM{type="image" search="nature" class="foswikiLeft"}%
%LOREM{type="image" search="people" class="foswikiLeft"}%
%LOREM{type="image" search="city" class="foswikiLeft"}%
%LOREM{type="image" search="fruits" class="foswikiLeft"}%
%LOREM{type="image" search="water" class="foswikiLeft"}%
%CLEAR%
%ENDSECTION{"examples"}%

Installation Instructions

You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server.

Open configure, and open the "Extensions" section. "Extensions Operation and Maintenance" Tab → "Install, Update or Remove extensions" Tab. Click the "Search for Extensions" button. Enter part of the extension name or description and press search. Select the desired extension(s) and click install. If an extension is already installed, it will not show up in the search results.

You can also install from the shell by running the extension installer as the web server user: (Be sure to run as the webserver user, not as root!)
cd /path/to/foswiki
perl tools/extension_installer <NameOfExtension> install

If you have any problems, or if the extension isn't available in configure, then you can still install manually from the command-line. See https://foswiki.org/Support/ManuallyInstallingExtensions for more help.

Dependencies

None

Change History

30 Apr 2024 improved the way sentences are extracted from a corpus
03 May 2022 some memory fixes
28 Mar 2018 initial release
This site is powered by FoswikiCopyright © by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding Middle Fork Home Wiki? Send feedback
Syndicate this site RSS