Roundcube Community Forum

 

how include custom html snippet within plugin to page template

Started by sago, September 03, 2019, 10:51:57 AM

Previous topic - Next topic

sago

Hi there,

I'm developing a new plugin on roundcube that show custom select on options list popup.

I've created a new plugin and enabled it in config.inc.php ( $config['plugins'] = array('myplugin'); ), then inside plugin folder I've created myplugin.php and /skins/elastic/template/myplugin.html.

inside myplugin.html I've written:

<div class="form-group row form-check">
    <label for="compose-am" class="col-form-label col-6"><roundcube:label name="returnreceipt" /></label>
    <div class="col-6 form-check">
      <roundcube:object name="amCheckBox" id="compose-am" noform="true" tabindex="2" class="form-check-input" />
    </div>
  </div>


now I want to include this file inside myplugin.php, so I can use the roundcube template engine. There is a way?

Thanks a lot.

JohnDoh

in your plugin you need to have a line like this:

$rcube = rcube::get_instance();
$rcube->output->send('pluginname.templatename');

there is a little more info here https://github.com/roundcube/roundcubemail/wiki/Plugin-API#templates
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...