mirror of
https://github.com/django/django.git
synced 2024-11-30 07:06:18 +01:00
97cb07c3a1
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8506 bcc190cf-cafb-0310-a4f2-bffc1f526a37
59 lines
2.1 KiB
Plaintext
59 lines
2.1 KiB
Plaintext
.. _ref-contrib-webdesign:
|
|
|
|
========================
|
|
django.contrib.webdesign
|
|
========================
|
|
|
|
.. module:: django.contrib.webdesign
|
|
:synopsis: Helpers and utilities targeted primarily at Web *designers*
|
|
rather than Web *developers*.
|
|
|
|
The ``django.contrib.webdesign`` package, part of the
|
|
:ref:`"django.contrib" add-ons <ref-contrib-index>`, provides various Django
|
|
helpers that are particularly useful to Web *designers* (as opposed to
|
|
developers).
|
|
|
|
At present, the package contains only a single template tag. If you have ideas
|
|
for Web-designer-friendly functionality in Django, please
|
|
:ref:`suggest them <internals-contributing>`.
|
|
|
|
Template tags
|
|
=============
|
|
|
|
To use these template tags, add ``'django.contrib.webdesign'`` to your
|
|
:setting:`INSTALLED_APPS` setting. Once you've done that, use
|
|
``{% load webdesign %}`` in a template to give your template access to the tags.
|
|
|
|
|
|
lorem
|
|
=====
|
|
|
|
Displays random "lorem ipsum" Latin text. This is useful for providing sample
|
|
data in templates.
|
|
|
|
Usage::
|
|
|
|
{% lorem [count] [method] [random] %}
|
|
|
|
The ``{% lorem %}`` tag can be used with zero, one, two or three arguments.
|
|
The arguments are:
|
|
|
|
=========== =============================================================
|
|
Argument Description
|
|
=========== =============================================================
|
|
``count`` A number (or variable) containing the number of paragraphs or
|
|
words to generate (default is 1).
|
|
``method`` Either ``w`` for words, ``p`` for HTML paragraphs or ``b``
|
|
for plain-text paragraph blocks (default is ``b``).
|
|
``random`` The word ``random``, which if given, does not use the common
|
|
paragraph ("Lorem ipsum dolor sit amet...") when generating
|
|
text.
|
|
=========== =============================================================
|
|
|
|
Examples:
|
|
|
|
* ``{% lorem %}`` will output the common "lorem ipsum" paragraph.
|
|
* ``{% lorem 3 p %}`` will output the common "lorem ipsum" paragraph
|
|
and two random paragraphs each wrapped in HTML ``<p>`` tags.
|
|
* ``{% lorem 2 w random %}`` will output two random Latin words.
|