Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
I would like to insert my webform other my webpage with IFrame (ex. webform is xxx.hu -> page yyy.hu).
I don't want to be theme on the webform page.
I have got a code but unfortunately it doesn't work.
I test this code ex: xxx.hu/node/40/iframe I get same page like without "iframe" :(
/**
* Override or insert variables into the page template.
*/
function bluemasters_preprocess_page(&$vars, $hook) {
// Prepare header.
$site_fields = array();
if (!empty($vars['site_name'])) {
$site_fields[] = $vars['site_name'];
}
if (!empty($vars['site_slogan'])) {
$site_fields[] = $vars['site_slogan'];
}
$vars['site_title'] = implode(' ', $site_fields);
if (!empty($site_fields)) {
$site_fields[0] = '<span>' . $site_fields[0] . '</span>';
}
$vars['site_html'] = implode(' ', $site_fields);
// Set a variable for the site name title and logo alt attributes text.
$slogan_text = $vars['site_slogan'];
$site_name_text = $vars['site_name'];
$vars['site_name_and_slogan'] = $site_name_text . ' ' . $slogan_text;
if (arg(0) == 'node' && is_numeric(arg(1)) && arg(2) == 'iframe') {
$vars['template_files'][] = 'page-iframe';
}
}
my code:
...
if (arg(0) == 'node' && is_numeric(arg(1)) && arg(2) == 'iframe') {
$vars['template_files'][] = 'page-iframe';
}
page-iframe.tpl.php:
<?php
// $Id: page.tpl.php,v 1.4 2009/07/13 23:52:58 andregriffin Exp $
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>" >
<head>
<title><?php print $head_title ?></title>
<?php print $head ?>
<?php print $styles ?>
<?php print $scripts ?>
</head>
<body>
<!-- Layout -->
<div class="container"> <!-- add "showgrid" class to display grid -->
<div id="main">
<?php print $content ?>
</div> <!-- /#main -->
</div> <!-- /.container -->
<!-- /layout -->
<?php print $closure ?>
</body>
</html>
THX
KALMI