Downloads and banners on tags
How to replace the Downloads catalogue and release page with theme files, make a template for a category, and place a banner or a whole place with one tag.
A template for a category
News, Downloads, the forum (a section) and the shop (a category) tell the engine the category of the page: the category address in Latin letters, digits and hyphen, up to 40 characters. Then the file <view>.<category-address>.tpl.html (for example views/news/show.tech.tpl.html or views/forum/section.api.tpl.html) is taken before the general <view>.tpl.html; other categories keep the general one.
The module also passes the page category description (plain text) to the shared page data; the core provides the {category.description} tag. Text cutting in post tags: limit=N characters, words=N words, wordsafe=1 — at a word boundary.
Downloads on tags
The theme files views/downloads/index.tpl.html (catalogue and category) and views/downloads/show.tpl.html (release page) replace the module's PHP views. Downloading still goes through the engine's usual addresses: the counter, access limits and passwords work as before.
| View | Tag | What it prints |
|---|---|---|
| catalogue | [each:cards] | releases: {item.title} {item.url} {item.description} {item.version} {item.date} {item.cover} {item.category} {item.category_url} {item.hits} {item.first} |
| catalogue | [each:rubrics] | categories: {item.title} {item.url} {item.count} {item.active} |
| catalogue | {category.title} {category.url} {category_description} {pager} {t.empty} | the page category (from the frame), its description, paging, the word «empty» |
| release | {item.title} {item.description} {item.version} {item.hits} {item.changelog} {item.requirements} {date} {cover} {cover_large} | the release itself |
| release | {category.title} {category.url} {files.count} [if:allow_download] | category, number of files, «there is something to download» |
| release | [each:files] | files: {item.name} {item.url} (download address) {item.platform} {item.arch} {item.size} {item.ext} {item.hits} {item.primary} {item.external} (host of an external link) |
| release | [each:sums] | checksums: {item.name} {item.checksum} — to verify the download |
A release page example:
<h1>{item.title}</h1><p>v{item.version} · {date} · downloaded {item.hits}</p>
[if:allow_download]
[each:files]<p><a href="{item.url}">{item.name}</a> {item.platform} {item.arch} {item.size} ↓{item.hits}</p>[/each]
[/if]
<h2>What is new</h2><p>{item.changelog}</p>
<h2>Requirements</h2><p>{item.requirements}</p>
[each:sums]<code>{item.name}: {item.checksum}</code>[/each]Banners on tags
In any tag file a banner is placed by number or as a whole place. The display rules are the same as for ordinary banners: period, schedule, device, pages, roles, countries, «first page only».
| Tag | What it prints |
|---|---|
{banner:5} | banner number 5 (the number is in the panel's banner list) |
{banner_place:sidebar} | all banners of the place |
Places: topbar, header, before_content, sidebar, after_content, footer, between_feed (between feed posts), between_comments (between comments).
The places between_feed and between_comments are drawn by the news and comments views themselves: a banner goes after every third feed post and after every fifth comment. In the panel a banner has roles (guest — a guest), countries (RU, UA — only there; -BY — everywhere except) and «first page of the section only». A page with such a banner does not go to the shared cache: the answer depends on the viewer.