Fields and templates are the foundation of any ProcessWire project. Incorrect structure leads to patching holes: twisted relationships, duplicate data, slow N+1 queries. For example, in one project without proper FieldtypePage configuration, we had to run 15 queries instead of one, increasing TTFB by 400 ms. Designing fields pays off tenfold: development accelerates by 30–50%, and maintenance becomes simpler. We have accumulated experience on 15+ projects, and each time the right architecture saved the client at least 40 hours of initial work. Contact us for a consultation on your project.
Field Types: What to Choose for Each Task
A field defines the type and storage method. ProcessWire has over 20 built-in types. Below is a table of the most common ones:
| Field Type | Storage | Use When |
|---|---|---|
FieldtypeText |
VARCHAR | Titles, short names |
FieldtypeTextarea |
TEXT | Articles, descriptions without HTML |
FieldtypeTextareaLanguage |
TEXT (per language) | Multilingual texts |
FieldtypeImage |
Separate table | Images with alt text |
FieldtypeFile |
Separate table | PDFs, documents |
FieldtypePage |
INT/table | Relations between pages |
FieldtypeRepeater |
Child pages | Repeatable blocks (e.g., benefits) |
FieldtypeOptions |
INT | Dropdown list |
FieldtypeCheckbox |
INT(1) | Yes/No |
FieldtypeInteger |
INT | Age, quantity |
FieldtypeFloat |
FLOAT | Prices, rating |
FieldtypeDatetime |
INT (unix timestamp) | Publication date |
FieldtypePage speeds up development by 5 times compared to direct SQL queries, and Repeater can replace up to 10 separate templates. Choosing the correct type reduces the number of fields by 20–30% and eliminates unnecessary tables.
Creating Fields and Typical Mistakes
Fields are created in Setup → Fields → Add New. The main thing is to set the Name (Latin, underscore) and Label correctly. A common mistake is using overly long machine names. Better review_date than data_otziva_klienta_v2.
Special attention to the FieldtypePage field. In its settings, be sure to:
- Dereference as:
Page(single) orPageArray(multiple) - Parent: restrict selection to children of a specific parent — prevents accidental connections
- Template filter: show only pages with the required template
// In code: single relation echo $page->category->title; // Multiple relation foreach ($page->tags as $tag) { echo "<span class='tag'>{$tag->title}</span>"; } Creating Templates: Step-by-Step
A template links fields to a PHP rendering file. The process:
- Create a PHP file in
/site/templates/ - In Setup → Templates → Add New — ProcessWire will find the file automatically
- Add needed fields on the Fields tab
- Configure Access (permissions)
- Configure URLs (allow/disallow child pages, URL suffix)
On the Advanced tab, there are key options:
- Page class — custom PHP class for pages of this template (enables custom methods like
getFullName()) - Prepend/Append file — include
_init.phpand_main.php - Cache time — cache template output for N seconds (for high-traffic pages)
- Allow page numbers — enable
/page2,/page3(for pagination)
Fieldset Field: Grouping in the Editor
FieldtypeFieldsetOpen / FieldtypeFieldsetClose groups fields visually without affecting storage. For example, an SEO block:
-
fieldset_seo_open— FieldtypeFieldsetOpen, label="SEO" -
meta_title— FieldtypeText -
meta_description— FieldtypeTextarea -
fieldset_seo_close— FieldtypeFieldsetClose
In the editor, these fields will be collapsed into a single "SEO" block.
Why Use Repeater Instead of Separate Templates?
Repeater allows editors to dynamically add/remove groups of fields. This is more flexible than creating separate templates for each block. Example: a "Benefits" block with fields icon, headline, text.
// Field features (Repeater) foreach ($page->features as $feature) { echo "<div class='feature-card'>"; echo " <img src='{$feature->icon->url}' alt=''>"; echo " <h3>{$feature->headline}</h3>"; echo " <p>{$feature->text}</p>"; echo "</div>"; } RepeaterMatrix (paid ProFields module) goes further: it allows multiple block types in one field — akin to ACF Flexible Content. This is our choice for complex landing pages.
How to Export and Import Configuration?
Moving structure between environments is a common pain. We use the RockMigrations module: it describes fields and templates in PHP code like Laravel migrations. An alternative is JSON export via API:
php -r " require '/var/www/site/index.php'; echo \$templates->get('product')->exportJSON(); " > product-template.json Configuration can also be exported through Setup → Export/Import.
What’s Included in Our ProcessWire Setup Work?
- Content structure analysis — define entities and relationships
- Field and template design — considering performance and editor UX
- Implementation — creating fields, templates, migrations
- Testing — checking for N+1 queries, Core Web Vitals
- Deployment and documentation — hand over description and editor guide
- Warranty — 3 months of support after delivery
Our engineers are ProcessWire certified and have experience with projects of any complexity. Proper structure saves up to 30% on development time. Request an audit of your current structure — we’ll find bottlenecks and propose optimizations.
Approach Comparison: Fieldtype vs Manual Implementation
| Aspect | ProcessWire Fieldtype | Manual Implementation (SQL+PHP) |
|---|---|---|
| Development speed | 5x faster | Slow, lots of code |
| Flexibility | High (built-in types) | Full, but more effort |
| Performance | Optimized by core | Depends on implementation |
| Maintenance | Easy, modular | Complex, monolithic |
Using ProcessWire fields gives an advantage in speed and reliability. ProcessWire Documentation: Fieldtypes.
Properly configured fields and templates are the key to fast development and happy editors. If you have doubts about architecture, contact us — we’ll help.







