Mac OSX 10.6.4
Apache 2.2.15 (Unix)
PHP 5.3.3
MySql 5.1.47
MODx 2.1.3-pl traditional
I am using a plugin to develop custom tv input and output types outside the core and am having a problem when the resulting tvs are parsed for output.
I am using the ’OnTVOutputRenderList’ event in my plugin to supply the path to the php render file (see the following example - I have both events registered to the plugin).
$core_path = 'path/to/customtvs';
switch ($modx->event->name) {
case 'OnTVOutputRenderList':
$modx->event->output($core_path.'elements/tv/web/output/');
break;
case 'OnTVOutputRenderPropertiesList':
$modx->event->output($core_path.'elements/tv/mgr/output/');
break;
}
All the custom tvs appear in the manager and are working fine up until the point of rendering the web page.
The problem I am having is that if I have more than one custom tv of the same type, only the first occurence is being parsed with the output file. The second and further tvs are simply inserted with their raw value.
For example I have a tvs for metatags where the user simply fills in a textarea with the relevent text.
The first tag in the template is parsed correctly -
<meta name="description" content="decription here" />
The secong tag renders with only the raw value -
I have tried to debug this problem without success. By writing to the log I have established that the ’OnTVOutputRenderList’ event fires twice during the page render, but the second time it appears to omit the custom path that it uses the first time. (Example from log below0
[2011-08-06 16:17:05] (ERROR @ /modx/index.php) /pathto/modx/core/model/modx/processors/element/tv/renders/web/output/ /pathto/customtvs/core/components/customtvs/elements/tv/web/output/
[2011-08-06 16:17:05] (ERROR @ /modx/index.php) /pathto/modx/core/model/modx/processors/element/tv/renders/web/output/
I would be extremely grateful if anyone can shed anylight on this issue. Am I using the event incorrectly? Or could it be a bug?
Thanks in advance.