nmac:
you need:
1) Chunk with form template, i.e. "AddBlogEntryForm" - html form with placeholders instead values ([+content+], [+tvigvenue+], etc)
2) TVs for blog record (igvenue, gigdate, gigtickets, and gigimage)
3) Snipet (AddBlog)
How to write snippet:
1) include docmanager.class.inc.php (copy this file to assets/libs/docapi/)
<?php
require_once('assets/libs/docapi/docmanager.class.inc.php');
php?>
2) Check to form is posted, i.e.:
<?php
$submited=isset($_POST['submit']);
php?>
3)
if(!$submited) - show the AddBlogEntryForm:
<?php
return $modx->getChunk('AddBlogEntryForm');
php?>
4)
else - you need to create new document (if all fields filled correctly):
<?php
$doc = new Document();
$doc->Set('parent',$GigsID);
$doc->Set('content',$_POST['content']);
$doc->Set('tvgigdate',$_POST['tvgigdate']);
...
$doc->Save();
php?>
You also can use (don’t forget exclude $_POST[’submit’] and other, my class don’t check for document field existing)
<?php
foreach($_POST as $name=>$value) $doc->Set($name=>$value);
php?>
Sorry for my english
P.S. cut "<php" tags, it’s for syntax highlighting