Docs - Ensure documents overview section renders Django template syntax

pull/11636/head
LB 2024-12-04 08:04:10 +10:00 zatwierdzone przez LB (Ben Johnston)
rodzic d48cf61701
commit bc34020e0d
3 zmienionych plików z 6 dodań i 4 usunięć
docs
advanced_topics/documents
releases

Wyświetl plik

@ -52,6 +52,7 @@ Changelog
* Docs: Fix non-functional link to the community guidelines in the Your first contribution page (Ankit Kumar)
* Docs: Introduce tags and filters by name in "Writing templates" docs (Clifford Gama)
* Docs: Add a new headless section to the documentation, incorporating parts of the 'are we headless' website content (Sævar Öfjörð Magnússon, Alex Fulcher)
* Docs: Fix Django HTML syntax formatting issue on the documents overview page (LB (Ben) Johnston)
* Maintenance: Close open files when reading within utils/setup.py (Ataf Fazledin Ahamed)
* Maintenance: Avoid redundant `ALLOWED_HOSTS` check in `Site.find_for_request` (Jake Howard)
* Maintenance: Update `CloneController` to ensure that `added`/`cleared` events are not dispatched as cancelable (LB (Ben) Johnston)

Wyświetl plik

@ -1,4 +1,4 @@
(overview)=
(documents_overview)=
# Documents overview
@ -69,7 +69,7 @@ This allows you to select a document file when creating or editing a page, and l
Here's an example template to access the document field and render it:
```html
```html+django
{% extends "base.html" %}
{% block content %}
{% if page.document %}
@ -138,7 +138,7 @@ class BlogPage(Page):
In `blog_page.html`, add the following block of code to display the document link in the page:
```html
```html+django
{% for block in page.documents %}
<a href="{{ block.value.url }}">{{ block.value.title }}</a>
{% endfor %}
@ -177,7 +177,7 @@ class PageWithCollection(Page):
Heres an example template to access the document collection and render it:
```html
```html+django
{% extends "base.html" %}
{% load wagtailcore_tags %}

Wyświetl plik

@ -67,6 +67,7 @@ depth: 1
* Fix non-functional link to the community guidelines in the [Your first contribution](../contributing/first_contribution_guide.md) page (Ankit Kumar)
* Introduce tags and filters by name in "Writing templates" docs (Clifford Gama)
* Add a new [](headless) section to the documentation, incorporating parts of the 'are we headless' website content (Sævar Öfjörð Magnússon, Alex Fulcher)
* Fix Django HTML syntax formatting issue on the [documents overview](documents_overview) page (LB (Ben) Johnston)
### Maintenance