File: webdesign.txt

package info (click to toggle)
python-django 1.2.3-3%2Bsqueeze15
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 29,720 kB
  • ctags: 21,538
  • sloc: python: 101,631; xml: 574; makefile: 149; sh: 121; sql: 7
file content (56 lines) | stat: -rw-r--r-- 2,148 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
========================
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
:doc:`"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
:doc:`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.