parts/django/docs/ref/contrib/webdesign.txt
changeset 307 c6bca38c1cbf
equal deleted inserted replaced
306:5ff1fc726848 307:c6bca38c1cbf
       
     1 ========================
       
     2 django.contrib.webdesign
       
     3 ========================
       
     4 
       
     5 .. module:: django.contrib.webdesign
       
     6    :synopsis: Helpers and utilities targeted primarily at Web *designers*
       
     7               rather than Web *developers*.
       
     8 
       
     9 The ``django.contrib.webdesign`` package, part of the
       
    10 :doc:`"django.contrib" add-ons </ref/contrib/index>`, provides various Django
       
    11 helpers that are particularly useful to Web *designers* (as opposed to
       
    12 developers).
       
    13 
       
    14 At present, the package contains only a single template tag. If you have ideas
       
    15 for Web-designer-friendly functionality in Django, please
       
    16 :doc:`suggest them </internals/contributing>`.
       
    17 
       
    18 Template tags
       
    19 =============
       
    20 
       
    21 To use these template tags, add ``'django.contrib.webdesign'`` to your
       
    22 :setting:`INSTALLED_APPS` setting. Once you've done that, use
       
    23 ``{% load webdesign %}`` in a template to give your template access to the tags.
       
    24 
       
    25 
       
    26 lorem
       
    27 =====
       
    28 
       
    29 Displays random "lorem ipsum" Latin text. This is useful for providing sample
       
    30 data in templates.
       
    31 
       
    32 Usage::
       
    33 
       
    34     {% lorem [count] [method] [random] %}
       
    35 
       
    36 The ``{% lorem %}`` tag can be used with zero, one, two or three arguments.
       
    37 The arguments are:
       
    38 
       
    39     ===========  =============================================================
       
    40     Argument     Description
       
    41     ===========  =============================================================
       
    42     ``count``    A number (or variable) containing the number of paragraphs or
       
    43                  words to generate (default is 1).
       
    44     ``method``   Either ``w`` for words, ``p`` for HTML paragraphs or ``b``
       
    45                  for plain-text paragraph blocks (default is ``b``).
       
    46     ``random``   The word ``random``, which if given, does not use the common
       
    47                  paragraph ("Lorem ipsum dolor sit amet...") when generating
       
    48                  text.
       
    49     ===========  =============================================================
       
    50 
       
    51 Examples:
       
    52 
       
    53     * ``{% lorem %}`` will output the common "lorem ipsum" paragraph.
       
    54     * ``{% lorem 3 p %}`` will output the common "lorem ipsum" paragraph
       
    55       and two random paragraphs each wrapped in HTML ``<p>`` tags.
       
    56     * ``{% lorem 2 w random %}`` will output two random Latin words.