With item_url and a reveal.html, every row of an alcove gets a page of its own. The reveal template is a complete HTML document; it pulls in the header and footer with {{ alcove:name }}.
{{ item_url }} in a tile is that row's address, so the list can link to it. Like tiles, there can be several reveal templates with conditions; here books out on loan get a different one.
Live result This page is rendered on request.
A Christmas Carol Charles Dickens, 1843 Bleak House Charles Dickens, 1853 Emma Jane Austen, 1815 Ethan Frome Edith Wharton, 1911 Frankenstein Mary Shelley, 1818 Great Expectations Charles Dickens, 1861 Persuasion Jane Austen, 1817 Pride and Prejudice Jane Austen, 1813 The Age of Innocence Edith Wharton, 1920 The Death of Ivan Ilyich Leo Tolstoy, 1886 The Last Man Mary Shelley, 1826 War and Peace Leo Tolstoy, 1869 Source the files behind the result above
content/alcoves/demo_bookpages/alcove.yaml
query: |
SELECT b.slug, b.title, a.name AS author, b.year, b.genre, b.available, b.summary
FROM books b
JOIN authors a ON a.id = b.author_id
ORDER BY b.title
item_url: docs/detail-pages/{{ slug }}
back_url: /docs/detail-pages/
reveal:
- condition: "available == 1"
file: reveal.html
- file: reveal-loan.htmlcontent/alcoves/demo_bookpages/tile.html
<li><a href="/{{ item_url }}/">{{ title }}</a> <span>{{ author }}, {{ year }}</span></li>content/alcoves/demo_bookpages/reveal.html (main part)
<p class="eyebrow">A detail page, made from one row</p>
<h1>{{ title }}</h1>
<p class="lede">{{ summary }}</p>
<dl class="facts">
<div><dt>Author</dt><dd>{{ author }}</dd></div>
<div><dt>Year</dt><dd>{{ year }}</dd></div>
<div><dt>Genre</dt><dd>{{ genre }}</dd></div>
<div><dt>Shelf</dt><dd>On the shelf</dd></div>
</dl>
</article>
</main>
{{ alcove:colophon }}Good to know Detail pages are built once, when the site is built. A row added to the database later gets its page on the next rebuild. They have no page file, so {{ page.* }} does not work in them, and they are not in the sitemap. Access rules do not protect them. Do not put private rows in an alcove with reveal. Previous Pagination
Next Feeds and file pages