Hi folks. I've been lurking here for a while, trying to figure how things work before I overhaul my site. Anyway, I've no doubt I'll be asking for help at some point(s), so I didn't want to arrive empty handed. MarkupLorenIpsum Module for Processwire This module hooks after Page Render, and replaces any [lorem] tags found with random lorem ipsum text.
How to use [lorem<length><format>] <length> (optional) number - sets the length of the output. Default is 5. <format> (optional) char - sets the format of the output, as follows: - 't' - formatted text. Each paragraph begins with a tab char. 'p' - plain text. No tabs or line feeds. 'h' - html. Each paragraph is formatted with <p>...</p>, except the first and last (see below). 'H' - html. Each paragraph is formatted with <p>...</p>. The default format is 'h' unless the length is <= the default, in which case the format is 'p' - useful for headings etc. The [lorem] tag is replaced with the generated text. Note that paragraph length is 100 (this is set in the construtor). Samples: - 'h': lorem ipsum lectus dapibus ... sapien malesuada.</p><p> auctor sapien, arcu inceptos ... consequat metus litora. 'H': <p>lorem ipsum lectus dapibus ... sapien malesuada.</p><p> auctor sapien, arcu inceptos ... consequat metus litora.</p> 't': \tlorem ipsum lectus dapibus ... sapien malesuada.\n\n\t auctor sapien, arcu inceptos ... consequat metus litora. 'p': lorem ipsum lectus dapibus donec sapien malesuada auctor sapien, arcu inceptos aenean consequat metus litora. Examples :- [lorem] - renders 5 words, plain format [loremh] - renders 5 words, html format [lorem20] - renders 20 words, html format [lorem20H] - renders 20 words, html format, wrapped in <p>...</p> [loren20p] - renders 20 words, plain format [loren20t] - renders 20 words, text format The reason for the two html options is that the textarea editor inserts <p> tags itself, so you would get <p><p>lorem...dapibus</p></p>. By default the extra tags are stripped, but this can be overidden if desired.
It's built using example2 from the HelloWorld module as a wrapper for Mathew Tinsley's LoremIpsumGenerator class.
markuploremipsum.zip