-
Posts
263 -
Joined
-
Last visited
-
Days Won
6
interrobang's Achievements
-
Experimental SQLite and PostgreSQL support for FieldtypeFlex I’ve implemented support for SQLite and PostgreSQL in FieldtypeFlex. With Codex’s help, getting both backends working was surprisingly straightforward. The integration tests look promising, including nested Flex rows and selectors that follow Page References. How does performance compare with MySQL and MariaDB? I ran the same three FieldtypeFlex workloads on the same VM, with 360 pages containing 24 Flex rows each. These are median times in milliseconds; lower is better. FieldtypeFlex operation MySQL MariaDB SQLite (first run) SQLite (rerun) PostgreSQL (rerun) Load a page with 24 Flex rows 2.12 1.96 1.60 1.43 2.33 Filter pages by a numeric value in a Flex row 58.39 35.08 12.92 12.26 56.23 Edit a row and save the Flex field 17.61 10.11 5.36 5.14 25.42 SQLite was the surprise for me: in the first run, the numeric selector took about a third of the time it took on MariaDB, and the Flex save took about half as long. PostgreSQL was slower than SQLite in their direct comparison. Its selector time was close to the earlier MySQL result, but its save time was higher than either of the earlier MySQL or MariaDB results. SQLite was included in both runs as a reference; PostgreSQL wasn’t measured head-to-head against MySQL or MariaDB. These are ProcessWire API timings, not full admin page loads or saves. The benchmark didn’t cover uploads or simultaneous Flex saves. SQLite used ProcessWire’s default synchronous=NORMAL; with FULL, the Flex save in the rerun took 6.71 ms. Both backends are in the same experimental branch: feature/sqlite-postgresql-support . I don’t use either database in production myself, so I’m keeping this off main for now. I haven’t found any blockers in my own testing, but I’d like feedback from real projects before deciding whether to merge it. If you’re already trying ProcessWire with SQLite or PostgreSQL and use FieldtypeFlex, I’d love for you to give it a spin on a test copy of your site. I’m particularly interested in existing setups with nested rows, Page Reference selectors, or file and image fields. A quick “worked for me” is just as welcome as a bug report. If you hit a problem, please include your ProcessWire and database versions and what you were doing when it happened. Thanks to anyone willing to try it out!
-
Hi everyone, FieldtypeFlex 1.0.0 is here. When I posted the 0.7.0 update, the big news was a simple table editor for things like price lists. Using it on a live site now, alongside native inputs and nested content blocks, feels like a good moment to call it 1.0. It has become the field I’ve wanted in ProcessWire for years. Flex content works with ProcessWire’s native Pages Export/Import. You can move pages between installations using JSON, including nested rows, translations, and page references. File and image originals can be transferred from a publicly accessible HTTPS source. Flex media embedded in ZIP archives isn’t supported in 1.0.0. Tables grew beyond simple cells. Text and numbers still edit inline. TinyMCE, images, files, and page-tree inputs open under the row. You can also sort supported columns by clicking their headings or set a sort order in the definition. Rows are easier to work with at scale. Copy and paste one or several rows between compatible collections, even across ProcessWire installations. There are bulk actions and less work when adding a block to large, nested fields. Images feel more like native ProcessWire images. Flex uses the native image actions. Removing a block type doesn’t remove its content. Existing rows and their media are kept, Page Edit remains usable, and you decide when to clean up the old data. If you’re upgrading from 0.7.0, check your rowTitle definitions: use {heading} instead of heading, for example. The changelog has the details. I’ve updated the first post with two configurations and kept the original announcement below it. I’m already using Flex in a production project, where it’s been working well and I haven’t run into any issues so far. 1.0 is feature-complete for what I set out to build, and I plan to maintain it for the long term. I’d still love to see what you build with it, what feels awkward, or what you’d like to see in a future version. Thanks to everyone who tried the previews and shared feedback.
-
Hi everyone, A quick update since the 0.4.0 preview. FieldtypeFlex is now at 0.7.0, and the main addition is a simple table editor for things like price lists and product comparisons. You define the columns in the field definition, and editors can add, duplicate, reorder or hide rows. The cells use native ProcessWire inputs, and you can let editors change the column headings and add row labels. Here’s the PHP field definition for that price list. return [ 'prices' => [ 'type' => 'table', 'label' => 'Service price list', 'addRowLabel' => 'Add service', 'columns' => [ 'service' => ['type' => 'text', 'label' => 'Service', 'width' => '15rem'], 'duration' => ['type' => 'text', 'label' => 'Duration', 'width' => '8rem'], 'price' => ['type' => 'float', 'label' => 'Price (USD)', 'width' => '8rem'], 'booking' => [ 'type' => 'select', 'label' => 'Booking', 'width' => '10rem', 'options' => [ 'open' => 'Available', 'request' => 'On request', ], ], ], ], ]; Table columns currently only support a subset of ProcessWire’s Inputfields. You can use Text, Email, URL, Integer, Float, plain Textarea, Checkbox, Toggle, Select, Radios, Checkboxes, SelectMultiple, AsmSelect, TextTags and Datetime. For Page references, you can use Select, SelectMultiple, AsmSelect or PageAutocomplete. There are a few other changes since the preview: FieldtypeFlex now supports AdminThemeBridge support for language alternate fields such as `image_de`. The field settings can generate PHPDoc for your Flex definition, which is handy for IDE autocompletion. The tools for renaming and cleaning up stored properties now live in the field’s Actions tab.
-
Hi everyone, I've been experimenting with a CSS customization that brings the default AdminThemeBridge theme closer to the visual style of the Konkat theme. I also wanted the interface to feel calmer and make complex Page Edit screens easier to scan, especially when content is nested in FieldtypeFlex, Repeater or Repeater Matrix fields. The customization gives inputs, field groups and repeatable rows distinct but subtle visual roles, with consistent typography, fewer borders and quieter surfaces. Tree guides make nested structures easier to follow, and focusing a field highlights only the path to that field. The example uses nested FieldtypeFlex rows. It follows Bridge's configured primary colour and light/dark modes. The main settings are CSS custom properties at the top of one stylesheet. A small JavaScript fallback handles the tree geometry in browsers without CSS Anchor Positioning support (Safari). The attached package uses the existing theme hooks and requires no changes to ProcessWire, Bridge or field modules. It's an early prototype; I'd be interested in feedback, especially on the nested editing experience and whether parts of this approach would fit Bridge itself. bridge-custom.zip
- 29 replies
-
- 3
-
-
- admintheme
- web components
-
(and 1 more)
Tagged with:
-
Thanks @ukyo! I really appreciate your feedback, especially coming from the author of Mystique! I agree that a fieldtype like this would be a good addition to the ProcessWire core. For now, though, I also enjoy developing FieldtypeFlex independently. It gives me the freedom to experiment and refine things without having to worry too much about backwards compatibility at this stage. Regarding the entity layer, I haven't personally run into major limitations with ProcessWire's "everything is a Page" approach so far, so I don't really have a strong opinion on that. But WireEntries definitely sounds like an interesting project, and I'm curious to see how it develops! Thanks again for sharing your thoughts!
-
Thanks! There's definitely quite a bit of overlap. Mystique and ProFields Custom Fields cover many of the same basics. FieldtypeFlex adds nested Objects, repeatable Rows (similar to ReapeaterMatrix), File/Image fields and more advanced selectors if you need them. ProFields Custom Fields has the advantage of ListerPro integration (not yet tested with FieldtypeFlex) and ProFields support from Ryan. Once repeatable properties and File/Image support are added, I'd probably prefer it over my own module. I built FieldtypeFlex mainly because I wanted those features now, while still using native ProcessWire Inputfields. It has a pretty extensive test suite, although it's still a pre-release.
-
FieldtypeFlex Structured content in one ProcessWire field, edited with native Inputfields. Hi everyone, This is the field I’ve wanted in ProcessWire for years. I first shared an early version here, and I’m proud of what it’s become. I wanted to give editors a page that makes sense to them without having to create a new ProcessWire field for every little property or a separate page for every content block. For me, 1.0 is feature-complete: it covers what I set out to build, and I’m already using it in production. I plan to maintain it for the long term. That doesn’t mean the feature list is closed. If there’s something you’d like to build with Flex and can’t, I’d love to hear what’s missing. One field, familiar inputs You define the structure in code. Editors work in the regular ProcessWire page editor. Keep definitions in Git alongside the templates that render them, and use inputs like Date, AsmSelect, Checkboxes, TinyMCE, Page references, multilingual text, and native File and Image editors. Objects are fixed groups for things like a contact card or display settings. Rows are repeatable blocks. Different block types can sit next to each other, and a block can contain its own Rows. Tables give each row the same columns. Simple values can be edited in place, while richer inputs open below the row. 01 / A page with text and gallery blocks Create a field called content of type Flex, add it to your template, and save the following as site/templates/flex-fields/content.php. Enable InputfieldTinyMCE for this example. <?php namespace ProcessWire; return [ 'blocks' => [ 'type' => 'rows', 'label' => 'Content blocks', 'types' => [ 'text' => [ 'label' => 'Text', 'rowTitle' => '{title|"Untitled text"}', 'children' => [ 'title' => ['type' => 'text', 'label' => 'Section title'], 'body' => ['type' => 'TinyMCE', 'label' => 'Body'], ], ], 'gallery' => [ 'label' => 'Gallery', 'children' => [ 'images' => ['type' => 'image', 'label' => 'Images', 'maxFiles' => 6], ], ], ], ], ]; In Page Edit, choose Text or Gallery each time you add a block. You can mix them, drag them into order, hide a block, or copy it to a compatible Flex collection. On the frontend, your templates stay in charge. For example, render rich text or use native image resizing: foreach($page->content->blocks as $block) { if($block->rowType() === 'text') { echo '<h2>' . $sanitizer->entities($block->title) . '</h2>'; echo $block->body; } elseif($block->rowType() === 'gallery') { foreach($block->images as $image) { $thumb = $image->size(800, 600); $alt = $sanitizer->entities($image->description); echo "<img src='{$thumb->url}' alt='$alt'>"; } } } $matches = $pages->find('content.blocks.text.title*=Architecture'); 02 / An editable service price list For a table, each row has the same columns. Here’s the complete definition for a second Flex field called services, saved as site/templates/flex-fields/services.php. <?php namespace ProcessWire; return [ 'prices' => [ 'type' => 'table', 'label' => 'Service price list', 'editableHeaders' => true, 'columns' => [ 'service' => ['type' => 'text', 'label' => 'Service'], 'price' => ['type' => 'float', 'label' => 'Price (€)'], 'details' => ['type' => 'TinyMCE', 'label' => 'Details'], ], ], ]; Names and prices are edited right in the cells. Click Details to open TinyMCE below the row. Images and files can use a detail editor too. Leave out editableHeaders if you want to keep the column headings fixed in code. Watch it in Page Edit FieldtypeFlex-PageEditor-Demo.mp4 MIT licensed. Requires ProcessWire 3.0.259+, PHP 8.1+, and MySQL 8.0+ or MariaDB 10.11+ with InnoDB. The official GitHub README is the best place to check for current setup instructions and examples. https://processwire.com/modules/fieldtype-flex/ https://github.com/phlppschrr/FieldtypeFlex Edit: I’ve updated this first post for 1.0.0. The original 0.4.0 preview announcement is preserved below for context.
-
How to Leverage AI for Smarter ProcessWire Development
interrobang replied to bernhard's topic in Dev Talk
😲 I have no idea how context7's “related skills” are created. The complete setup, including the markdown conversion, is in the other repo https://github.com/phlppschrr/processwire-knowledge-base. The Python code for this is mostly vibe-coded with codex 5.2, and partly with gemini 3 pro. I have to admit that I haven't looked at the resulting Python code, but at least on my computer it works reliably. The repo indexed by context7 currently only contains the Markdown version of the ProcessWire API documentation as Markdown. As long as Ryan hasn't built prompt injecting into his phpdocs, it should be safe. I don't know yet how to best use the repository. I would appreciate input on how to write the skill to make the content usable for an LLM without bloating the context window. Probably the way via context7 is more promising than searching the local md files with grep. By the way, I've also started using gemini to break down the blog articles into individual, uniformly structured snippets with frontmatter metadata. I can imagine that this would be quite good for context7. However, it hasn't been committed yet. Unfortunately, I have to get back to customer work now... Example of a generated snippet: -
Done. https://context7.com/phlppschrr/processwire-api-docs
-
Generates a .phpstorm.meta.php file for ProcessWire autocompletion in PhpStorm. Features Autocomplete wire container keys for wire('...') and Wire::wire('...') Autocomplete module names for Modules::get() and Modules::install() Autocomplete field names for Fields::get() Autocomplete template names for Templates::get() Autocomplete unique page names for Pages::get() Autocomplete hookable methods for Wire::addHook*() Autocomplete page status constants/strings for Page::status(), addStatus(), removeStatus(), hasStatus() Autocomplete field flags for Field::addFlag(), removeFlag(), hasFlag() Autocomplete template cache-expire constants for Template::cacheExpire() Autocomplete Inputfield collapsed constants for Inputfield::collapsed() Autocomplete sort flags for WireArray::sort()/sortFlags()/unique() and PageArray::sort()/sortFlags()/unique() Optional: Field type autocompletion per Page class (when enabled in module config) Usage Default path: site/assets/.phpstorm.meta.php (configurable in module settings). The file regenerates automatically when fields, templates, or modules change (debounced). You can manually regenerate from the module settings screen. Optional: enable "Generate page-class field metadata" in module settings for field type hints per Page class. This is intentionally basic. For richer field stubs, use AutoTemplateStubs. Examples Modules $tracy = $modules->get('TracyDebugger'); // Autocomplete + correct class type for navigation and code insight Wire Container $page = wire('page'); $pages = $this->wire('pages'); $cache = wire('cache'); // Autocomplete for keys like page/pages/cache/etc. Fields $body = $fields->get('body'); // Autocomplete field names, fewer typos Templates $tpl = $templates->get('basic-page'); // Autocomplete template names Pages $home = $pages->get('/'); // Maps to the page class when page classes are enabled Page Status $page->status(Page::statusHidden); $page->addStatus('draft'); $page->removeStatus(Page::statusUnpublished); $page->hasStatus('locked'); Field Flags $field->addFlag(Field::flagAutojoin); $field->removeFlag(Field::flagAccess); $field->hasFlag(Field::flagGlobal); Template Cache Expire $template->cacheExpire(Template::cacheExpireParents); Inputfield Collapsed $inputfield->collapsed(Inputfield::collapsedYesAjax); Sort Flags $items->sort('title', SORT_NATURAL | SORT_FLAG_CASE); $items->sortFlags(SORT_NATURAL); $items->unique(SORT_STRING); Page-Class Field Metadata (Optional) $home = $pages->get('/'); // $home is HomePage (page class) // Field types are inferred from the template fieldgroup // e.g. $home->hero_image -> Pageimage or Pageimages depending on field settings Hooks $wire->addHookAfter('Pages::save', function($event) { // Autocomplete hookable methods while typing the hook string }); Notes Hook scanning reads ProcessWire core, modules, and admin templates to build the hook list. If page classes are enabled, page names map to their page class; otherwise they map to Page. Improvement suggestions and PRs are welcome. https://github.com/phlppschrr/ProcessWirePhpStormMeta
-
- 13
-
-
-
Do you know if we can create our own repo that only contains the Markdown APIDocs and use it for content7, or does it have to be the official repo?
-
https://github.com/phlppschrr/processwire-knowledge-base
-
@gebeer I have started developing a ‘processwire-knowledge-base’ skill. To do this, I converted all blog articles and tutorials from the website as well as the API docs into Markdown. However, I haven't tested the skill yet. I think it still needs some fine-tuning. It's still a private repo at the moment, but if you're interested in taking a look, I'm happy to make it public.
-
@BitPoet Have you had time to look at the PR yet? Is there anything that needs to be adjusted? Has anyone else tested this version besides me? I haven't noticed any problems so far.
-
interrobang changed their profile photo
-
Hi all, I just opened two PRs for AutoTemplateStubs. First one adds/extends ProFields stubs (Table, Textareas, Multiplier, RepeaterMatrix, Custom) + some refactoring The second PR adds an optional PHPDoc injection into custom Page classes. It only edits a clearly marked region (//region AutoTemplateStubs ... //endregion). If the marker is missing, nothing is changed. If the class doesn’t exist yet, it creates an empty class with the marker. So it’s opt‑in and hopefully safe. Happy to adjust if needed.