webdesign.txt 2.0 KB

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