• Is it possible to make any edits to the Welcome Mat templates? I’d like to be able to place the text in a set spot, or at least add a Name field to some of the templates that don’t have them.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Bas Schuiling

    (@basszje)

    Hi Abbi,

    At this time it’s unfortunately not that easy. However if you are comfortable with some HTML / CSS it’s quite easy to create your own templates.

    Thread Starter abbiperets

    (@abbiperets)

    OK, thanks! And if I create my own template, how would I upload it?

    Plugin Author Bas Schuiling

    (@basszje)

    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

    1. Copy the template that’s closest to your goal
    2. Put this in a subdirectory of your child theme (wmtemplates)
    3. Rename the directory and the file name to your template name (tpl and txt must have the same name as the directory!)
    4. 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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add a field?’ is closed to new replies.