Templates
Dynamics CRM Integration template files contain the markup and template structure for the front-end of your site. If you open these files, you will notice that they all contain hooks that allow you to add/move content without editing the template files themselves. Plugin template files shouldn't be touched because changes would be lost during the next plugin update.
Template files can be found in the templates
directory inside the plugin (e.g. /wp-content/plugins/integration-dynamics/templates
). You can edit these files in an upgrade-safe way using overrides. Copy the contents of this directory into a directory within your theme named wordpress-crm
, keeping the same file structure: /wp-content/themes/theme-name/wordpress-crm/
. The copied files will now override default template files.
Using custom templates
There are two ways to add custom templates:
- Create a directory
wordpress-crm
in your active theme directory and add the templates you need. - Use
wordpresscrm_locate_template
filter to add a custom template path. Filter handler would look like this:
<?php
add_filter( 'wordpresscrm_locate_template', function( $template, $template_name, $template_path ) {
if ( !file_exists( $template ) ) {
return '/custom-directory/templates/' . $template_name;
}
return $template;
}, 10, 3 );