{lorem}
Placeholder text - Lorem ipsum and Latin words - in words, sentences or paragraphs, the same text for the same seed.
Syntax
{lorem}
{lorem words=4}
{lorem sentences=2, seed=7}
{lorem paragraphs=3, sentences=4, varied}
Options
-
words - So many words exactly, as sentences; fewer than five are a title, without a full stop. 50 when no length is given.
-
sentences -
So many sentences of six to fourteen words; with
paragraphs, the sentences of each paragraph. -
paragraphs -
So many
<p>paragraphs, of four to seven sentences unlesssentencessays. -
seed - Another text, the same again for the same seed - default 0.
-
varied - Bare option: leave the classic opening "Lorem ipsum dolor sit amet" out - for the second text on a page.
Description
{lorem} writes placeholder text: "Lorem ipsum dolor sit amet, ..." and then Latin words, for a layout that has to be filled before its copy is written. Without a length it is 50 words. words= gives so many words exactly, made into sentences - fewer than five are a title, capitalised and without a full stop. sentences= gives so many sentences of six to fourteen words, paragraphs= so many <p> elements of four to seven sentences, or of sentences= each when both are given.
The words are picked by the seeded sequence of lib/fake.php, the same on every machine and every request: a page does not change each time it is loaded, and a test can compare it. seed= asks for another text - any value, a number or a word - and varied leaves the classic opening out, so two placeholders on one page do not start alike. The sequence's own state is put back afterwards, so a page that seeds the padFake* functions for its data gets the same values with or without a {lorem} on it.
A length that is no number from 1 to 10000, and words= beside sentences= or paragraphs=, are strict errors.
Examples
Words, sentences, paragraphs
A title of four words, a lead of two sentences and two paragraphs of three sentences.
<article style="max-width:60ch">
<h3>{lorem words=4}</h3>
<p><strong>{lorem sentences=2, seed=2, varied}</strong></p>
{lorem paragraphs=2, sentences=3, seed=3, varied}
</article>
Lorem ipsum dolor sit
Semper diam aliquam per nec dictumst montes facilisis at sapien. Potenti senectus accumsan felis, dui vulputate.
Luctus quis facilisis sociosqu tortor, iaculis sagittis ultrices parturient pulvinar mus sollicitudin fusce. Tempus malesuada cubilia odio quis semper curae erat lacus iaculis varius hendrerit risus. Eu etiam facilisis quisque felis viverra sodales ligula habitasse eros sed sollicitudin euismod.
Auctor nostra mus habitant, interdum quam. Neque at ornare hendrerit pellentesque quisque dictumst himenaeos mauris enim, quam tempor. Tincidunt efficitur ullamcorper efficitur potenti cras convallis curae.
A seed per card
The same tag with another seed in every card - varied text, the same again on every request.
<div style="display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px">
{sequence '1..3', name='card'}
<div style="border:1px solid rgba(128,128,128,.35);border-radius:8px;padding:10px 12px">
<strong>{lorem words=2, seed=$card, varied}</strong>
<p style="margin:6px 0 0">{lorem words=12, seed=$card + 100, varied}</p>
</div>
{/sequence}
</div>
Etiam sodales nostra bibendum magna habitasse consequat nisl nullam feugiat nullam curabitur.
Arcu ultrices nec faucibus, torquent id consequat felis, arcu rutrum curae montes.
Iaculis sapien aliquet netus rhoncus vulputate volutpat vestibulum. Maximus lacinia quam posuere.
See also
- {placeholder} Draws a grey image placeholder as inline SVG - crossing lines and the size or a text in the middle.
- {excerpt} Cuts a long text to whole words with an ellipsis, centred on the first match of search words, every match marked.
- {sequence} Generates a range, a list or one of 80 mathematical sequences, and iterates its values.