Alright. So, since you are the first to ask, please note that this is something we hope to make this a bit more easy in the future.
You can get a sample template from the /templates directory in the plugin. You will see that the name of the template correspondends with the directory name.
In the template directory there are several files required. I’ll take the air template as example.
- air.txt – This is the file for name, description, and template ( more on that later )
- air.tpl – This is the main HTML that is the mat. You can see some extra defitions.
You can see the air template refer to a template called ‘welcomemat-standard’. You will find this XML file in the main template directory. These are the fields you see in the editor part.
e.g. In air.tpl you will see an input field with this tag : ‘ field=”input_email” ‘ . You can find input_email in the XML file.
To create your own template these are the steps you should take
- Copy the template that’s closest to your goal
- Put this in a subdirectory of your child theme (wmtemplates)
- Rename the directory and the file name to your template name (tpl and txt must have the same name as the directory!)
- Edit the template, CSS, images and fields as you see fit
If you want to edit the fields as well, copy the XML file to the same directory, rename it and put the same name at the template: tag in the template.txt file.
Put this snippet in your functions.php to make the plugin search your custom directory for templates :
if (function_exists('MaxInbound\MI'))
{
\MaxInbound\MI()->offer('system/templates', 'wm_templates' );
}
function wm_templates()
{
$path = get_stylesheet_directory() . '/wmtemplates/';
$url = get_stylesheet_directory_uri() . '/wmtemplates/';
return \MaxInbound\MI()->templates()->findTemplates($path, $url);
}
I know it’s complicated, but please don’t hesitate to ask any questions if you decide to give it a go.