Roundcube Community Forum

News and Announcements => General Discussion => Topic started by: sago on September 03, 2019, 10:51:57 AM

Title: how include custom html snippet within plugin to page template
Post by: sago on September 03, 2019, 10:51:57 AM
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 (
Code: [Select]
$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:

Code: [Select]
<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.
Title: Re: how include custom html snippet within plugin to page template
Post by: JohnDoh on September 04, 2019, 02:07:38 AM
in your plugin you need to have a line like this:
Code: [Select]
$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