Repository navigation
Starter Packs
A starter pack is a ready-made website for a kind of business, in one .json file: a theme, pages, menu links, starter articles and settings. Installing one asks for a few business details and writes them into the content, so the same pack becomes anyone's site. Needs Wren 1.7.0 or newer.
- Put the pack's
.jsonfile in a folder calledpacksbesideindex.php, or upload it under Settings → Starter packs. - Choose Use this pack. The form is pre-filled with example details so you can see the finished site straight away.
- Choose whether to use the pack's design, make its home page your homepage, and remove the "Hello, world" sample article.
- Tick the confirmation and choose Install pack.
On a brand-new site, if the packs folder has packs in it, setup takes you straight to this screen.
Installing never overwrites anything:
- If a page address is already taken, the new one gets
-2on the end, and the pack's own links between its pages follow the change. - An existing
theme.htmlis kept astheme-YYYYMMDD-HHMMSS.html.bak. - Everything happens in one transaction: if something fails, nothing is added.
Packs are install files, not pages, so Wren puts its own .htaccess in the packs folder to stop them being downloaded, and the supplied .htaccess refuses /packs/*.json too. On hosts without .htaccess support, delete a pack from the folder once it's installed.
After installing, everything is ordinary Wren content you can edit or delete.
The details you enter are saved under Settings → Business details. A theme can show them with [[key]] tags, such as [[phone]] in the header, so changing a phone number in Settings updates every page's header and footer. Text inside pages and articles was written at install time, so edit those directly.
{
"wren_pack": 1,
"id": "trades",
"name": "Trades: plumbing and heating",
"version": "1.0.0",
"requires": "1.7.0",
"description": "Shown on the Starter packs screen.",
"author": "49 Systems",
"swatches": ["#14304a", "#b5651d"],
"fields": [ ... ],
"settings": { ... },
"pages": [ ... ],
"links": [ ... ],
"articles": [ ... ],
"theme": "<!doctype html> ..."
}| Key | Required | Notes |
|---|---|---|
wren_pack |
yes | Format version. Always 1 for now. |
id |
yes | Lowercase letters, numbers and hyphens. Uploading a pack with the same id replaces it. |
name |
yes | |
requires |
no | Minimum Wren version. |
swatches |
no | Up to five hex colours shown as a preview. |
theme |
no | A complete theme.html, as a string. |
Each field becomes a box on the install form and a [[key]] token.
{"key": "phone", "label": "Phone number", "example": "0117 496 0321", "required": true, "hint": "shown in the header"}key must start with a letter and use only lowercase letters, numbers and underscores. multiline: true gives a larger box.
Wren also provides these tokens without asking:
| Token | Value |
|---|---|
[[phone_link]] |
The phone field with spaces removed, for tel: links |
[[year]] |
The current year |
[[url_<slug>]] |
The address of a page or article in the pack, e.g. [[url_burst_pipe]] for slug burst-pipe (hyphens become underscores) |
Tokens are filled in titles, descriptions, bodies, link URLs and settings. In bodies, values are HTML-escaped.
Only these can be set: site_title, tagline, meta_description, og_image, blog_title, blog_slug, blog_position, posts_per_page, comments, home_page. home_page is a pack page's slug and is only applied if the installer ticks "Make the pack's home page my homepage".
{"slug": "boilers", "title": "Boilers", "parent": "services", "position": 11,
"show_title": 1, "description": "For search results.", "body": "Markdown or HTML"}- Pages:
parentis another pack page's slug (one level, as in the menu).allow_commentsdefaults to 0. - Links: use
urlinstead ofbody;newtab: 1opens in a new tab. A blankurlmakes a heading-only menu label. - Articles:
days_agoback-dates them so a new site doesn't show every article on today's date.allow_commentsdefaults to 1.
Bodies are Wren markdown, and raw HTML passes through. An HTML block must start with a tag and contain no blank lines, because Wren splits blocks on blank lines and only a block that starts with a tag is left untouched.
Besides the standard tags (see Theming), 1.7.0 adds:
-
{{url:privacy}}gives the address of the page with that slug, with or without pretty URLs. -
[[key]]shows a business detail from Settings. Unknown keys show nothing.
Start here
Using Wren
Under the hood
Keeping it running
Wren Shop - Installation & Setup