Blog Sections Open

Creating Resources from eForm Submissions with docmanager

This pattern turns an ordinary form submission into a structured content-creation workflow inside Evo.

A practical implementation can use docmanager inside an eForm callback to create a new resource and fill both standard fields and TVs from submitted values.

Example callback

<?php
function createworknew(&$fields) {
    require_once('assets/libs/docmanager/document.class.inc.php');

    $doc = new Document();
    $doc->Set('parent',17);
    $doc->Set('pagetitle',$fields['fio']);
    $doc->Set('longtitle',$fields['spec']);
    $doc->Set('description',$fields['tel']);
    $doc->Set('introtext',$fields['mail']);
    $doc->Set('tvmetod',$fields['metod']);
    $doc->Set('tvrab',$fields['rab']);
    $doc->Set('tvcity',$fields['city']);
    $doc->Set('content',$fields['resume']);
    $doc->Set('published','1');
    $doc->Set('alias',time().$alias);
    $doc->Save();
    return true;
}
?>

Why this is useful

  • applications, resumes, requests, and submissions can become managed resources
  • the manager can take over after the form creates the first record
  • TVs make it easy to preserve structured submission fields

This is a good example of Evo acting as both a site and a lightweight application backend.

Newer post

Showing Protected Output Only to Logged-In Managers with a Tiny Snippet

A minimal Evolution snippet pattern for showing content only to authenticated manager users.

Older post

Showing a Video Block in Ditto Only When the TV Has a YouTube ID

How to conditionally render a video block in Ditto listings when a video TV may be empty and the project needs safe fallback markup.