Blog Sections Open

Creating Resources from eForm Data with docBuilder

Turning a form submission into a new resource becomes much easier when the field-to-document mapping is declared in one readable array.

This donor shared a simpler pattern for creating resources from eForm submissions. Instead of forcing heavy custom code, it mapped form fields directly onto resource fields and default values.

Example mapping

return array(
    'field' => array(
        'email' => 'pagetitle',
        'comments' => 'content',
        'name' => 'keyw'
    ),
    'value' => array(
        'template' => 1,
        'longtitle' => 'asd'
    )
);

Why this pattern works

It keeps the creation rules readable for non-specialists. Once the mapping is understandable, teams can adapt the target template, fields, and defaults without rewriting the whole creation flow.

Recommendation

For legacy Evo projects, declarative mappings like this are often easier to maintain than large one-off snippets with form parsing scattered across the code.

Newer post

Choosing the Right System Event for Region Switching

If a region switch is driven by URL parameters, the best event is the one that sees the request early enough to store the choice before page-specific logic depends on it.

Older post

Using antispam and Captcha with JotX

If antispam seems to “do nothing”, verify what fields it actually injects and whether your template or theme is hiding them.