I've got this little plugin almost note for note from here:
http://rtfm.modx.com/revolution/2.x/case-studies-and-tutorials/adding-custom-fields-to-manager-forms
It does work, gets & sets the TVValue I need it to,
<?php
$id = isset($_REQUEST['id']) ? $_REQUEST['id'] : 0;
$resource = $modx->getObject('modResource', $id);
$fields = '';
switch ($modx->event->name) {
case 'OnDocFormPrerender':
// nothing to do here
break;
case 'OnDocFormRender':
$value = '';
$value = $resource->getTVValue('keywords');
$fields = '<div class="x-form-item x-tab-item">
<label class="x-form-item-label" style="width:auto;">Keywords</label>
<div class="x-form-element">
<input type="text" name="keywords" value="'.$value.'"
class="x-form-text x-form-field" style="width:auto;"/>
</div>
</div>';
$modx->event->output($fields);
break;
case 'OnDocFormSave':
$resource->setTVValue('keywords', $_POST['keywords']);
break;
}
return;
**HOWEVER**
It does a couple weird things, looking at the attached file,
i. It adds a path above the form field label. ~ no idea where that is coming from or how it got there. How do I get rid of that? [no errors, modx log or in server log]
ii. The field itself is of a set length, how do I set it so that it auto-resizes with the rest of the form fields?
iii. Is it possible to change the order of where it appears on the form? [ideally above description]