0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-29 09:33:54 +01:00

Merge pull request #1431 from kaedroho/writing-templates-cleanup

"Writing templates" cleanup
This commit is contained in:
Tom Dyson 2015-06-22 10:48:32 +01:00
commit e074aaf5bb

View File

@ -1,13 +1,7 @@
=================
Writing templates
=================
.. contents:: Contents
:local:
========================
Overview
========================
Wagtail uses Django's templating language. For developers new to Django, start with Django's own template documentation:
https://docs.djangoproject.com/en/dev/topics/templates/
@ -16,9 +10,8 @@ https://docs.djangoproject.com/en/dev/ref/templates/api/
You should be familiar with Django templating basics before continuing with this documentation.
==========================
Templates
==========================
=========
Every type of page or "content type" in Wagtail is defined as a "model" in a file called ``models.py``. If your site has a blog, you might have a ``BlogPage`` model and another called ``BlogPageListing``. The names of the models are up to the Django developer.
@ -48,9 +41,8 @@ The data/content entered into each page is accessed/output through Django's ``{{
Additionally ``request.`` is available and contains Django's request object.
==============
Static assets
==============
=============
Static files e.g CSS, JS and images are typically stored here::
@ -79,9 +71,8 @@ Images from the library must be requested using this syntax, but a developer's s
Read more about the image manipulation syntax here :ref:`image_tag`.
========================
Template tags & filters
========================
=======================
In addition to Django's standard tags and filters, Wagtail provides some of its own, which can be ``load``-ed `as you would any other <https://docs.djangoproject.com/en/dev/topics/templates/#custom-tag-and-filter-libraries>`_
@ -196,9 +187,8 @@ Notice that the full path name is not required and the path snippet you enter on
========================
Wagtail User Bar
========================
================
This tag provides a contextual flyout menu on the top-right of a page for logged-in users. The menu gives editors the ability to edit the current page or add another at the same level. Moderators are also given the ability to accept or reject a page previewed as part of content moderation.