This developer tip will help you assign a particular theme for a set of specific webforms.
function MYMODULE_theme($existing, $type, $theme, $path) {
$webform = array();
$webform_info = variable_get('MYMODULE_webform_info', array());
foreach($webform_info as $nid => $data ) {
$webform['webform_form_' . $nid] = array(
'render element' => 'form',
'template' => 'webform-form-ispace',
'path' => drupal_get_path('theme', 'MYTHEME') . '/templates',
'pattern' => 'webform_form_[0-9]+',
);
}
return $webform;
}
Note: $webform_info = variable_get(‘MYMODULE_webform_info’, array());
Here we get the list of webforms which needs to have template set.
Template file webform-form-ispace.tpl.php should be placed under the templates folder in the selected theme.
Our Services
Customer Experience Management
- Content Management
- Marketing Automation
- Mobile Application Development
- Drupal Support and Maintanence
Enterprise Modernization, Platforms & Cloud
- Modernization Strategy
- API Management & Developer Portals
- Hybrid Cloud & Cloud Native Platforms
- Site Reliability Engineering