ProcessWire Fields and Templates: Setup, Types, Optimization Tips

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

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:

Frequently Asked Questions

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1414
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1285
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    980
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1240
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    982
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    994

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) or PageArray (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:

  1. Create a PHP file in /site/templates/
  2. In Setup → Templates → Add New — ProcessWire will find the file automatically
  3. Add needed fields on the Fields tab
  4. Configure Access (permissions)
  5. 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.php and _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:

  1. fieldset_seo_open — FieldtypeFieldsetOpen, label="SEO"
  2. meta_title — FieldtypeText
  3. meta_description — FieldtypeTextarea
  4. 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.