Hi guys, big fan!
Coming across my first ever Drupal confusion. I have a local server, a staging server and a live server. These all have separate databases. I'm having a problem where I'm naming my webform template webform-form-6451.tpl.php and this is not corresponding to the staging or live server as when the webforms are created on these sites, they are issued with different IDs. I have managed to fix this issue for pages and nodes by simply using the hook_preprocess_node (something that only took me a couple of days to test and implement) however, I can't find how to do the same for webforms.
Ideally, if my webform were located at:
http://www.example.com/this-is-the-url-of-the-webform
I would want the template file to be named after the path alias as:
/sites/all/themes/themename/webforms/webform-form-this-is-the-url-of-the-webform.tpl.php
How can I go about this?
The code I used to do this for nodes is as follows:
function themename_v2_preprocess_node(&$vars, $hook) {
$suggestions = array();
// get node based on node ID
$suggestions[] = 'node-'. $vars['nid'];
// additional node template names based on path alias
if (module_exists('path')) {
// we already can have a path alias
if (isset($vars['node']->path)) {
$alias = ($vars['node']->path);
} else {
// otherwise do standard check