I'm trying to create a plugin and use the `template_container` hook to fill a container like this:
skins/larry/templates/login.html:
<roundcube:container name="testcontainer" id="testcontainer" />
plugins/myplugin/myplugin.php
class myplugin extends rcube_plugin
{
function init()
{
$this->rcmail = rcmail::get_instance();
$this->add_hook('template_container', array($this, 'test_hook'));
}
function test_hook($attr) {
if ($attr["name"] === "testcontainer") {
$content = $attr["content"];
$content .= html::tag('div', null, "I am testing this");
}
return array("content" => $attr["content"]);
}
}
I have added the plugin to config.inc.php like
$config['plugins'] = array('xskin', 'managesieve', 'password', 'myplugin');` so that is not the problem.
But when I load the login screen, the div does not show up. Does anyone know what I am doing wrong?
I can also say that it works when I use the "startup" hook and $this->api->add_content(html::tag(...), "testcontainer"); so I know that my plugin works in general.