I have a plugin that is a custom fieldtype. It works fine, and has a getInputHtml() method that behaves as expected.
Now, I have a second plugin, where I want to output the HTML from the Plugin 1 getInputHtml() method.
I have the FieldModel:
$field = $field->getField();
I have the Plugin 1 fieldtype object
$fieldtype = craft()->fields->populateFieldType($field, $element);
And I call the getInputHtml() method:
If I place the necessary files at the base of Plugin 2
plugin2/templates/plugin1/_field/input everything works fine. But I can't seem to access the input HTML template in the context of Plugin 1:
I've tried to update the Template Path in various ways before calling $fieldtype->getInputHtml():
craft()->path->setTemplatesPath(craft()->path->getPluginsPath()); craft()->path->setTemplatesPath(craft()->path->getPluginsPath() . 'plugin1/'); craft()->path->setTemplatesPath(craft()->path->getCpTemplatesPath());
Everything I have tried has resulted in a template error:
Unable to find the template "plugin1/_field/input".
Any ideas on what I'm doing wrong?