An open API service indexing awesome lists of open source software.

https://github.com/fixate/processwire-styleguide

A styleguide for how to create and use field names and templates in ProcessWire
https://github.com/fixate/processwire-styleguide

Last synced: 2 months ago
JSON representation

A styleguide for how to create and use field names and templates in ProcessWire

Awesome Lists containing this project

README

        

# ProcessWire Styleguide

A styleguide for creating manageable and predictable users, foundational pages, fields, and templates in [ProcessWire](http://processwire.com).

- [Pages](#pages)
- [Users](#users)
- [Fields](#fields)
- [Templates](#templates)

## Pages

- Settings

### Settings

- holds details relevant to the entire site. e.g. social media links, analytics settings, admin emails etc.
- is a parent to pages that do not have views, but are necessary for page fields. e.g. tags, colours, etc.

---

## Users

- Admin
- Editor
- Guests

### Admin

- Admins have full access to the admin

### Editor

- Editors are be granted create, edit, and delete roles for all necessary templates so as to edit and update content, but without being granted access to template and field settings

### Guest

- Guests should rarely be granted any more than view access to all templates

---

## Fields

- Naming Convention
- Tab Fields
- Page Fields
- Repeaters
- Field Settings

### Naming Convention

- all fields are lowercase and `snake_case`, except for those generated by ProcessWire (e.g. Tab fields)

### Tab Fields

- tab fields group related aspects of templates. e.g. Content, Banner, and SEO deserve their own tabs to declutter the admin
- generic tabs are useful for ease of reuse. e.g. `tab_generic_alpha`, `tab_generic_beta`, etc.
- tabs occuring reliably on templates may be given their own name. e.g. `tab_seo`

### Page Fields

- all page fields are prefixed with `pf_`. e.g. `pf_blog_category`

### Repeaters

- repeaters are prefixed with `rptr_`. e.g. `rptr_contact_details`

### Field Settings

- Text Field Styles
- Editing Capabilities

---

## Templates

- Naming Convention
- Order Of Fields

### Naming Convention

- all admin templates are lowercase and `snake_case`
- all template files are lowercase and `snake_case`
- templates which list children should be suffixed with `_index`. e.g. `team_member_index` listing individual `team_member` items

### Order Of Fields

- fields should follow the order they when rendered
- fields related to content, such as images and files fields, should be placed at the end of the list of fields for a template