By mallyone on
I have a form that I'd like to put in an iframe. I'd like to change the base template to a very minimal page.tpl.php and strip out everything but the headers and the content (basically).
in drupal 5 there was _phptemplate_variables($hook, $vars = array()), but that seems to be deprecated in 6, in 6 I'm trying hook_theme, but with no luck. I was hoping there might be a "drupal_base_theme('my_theme.tpl.php);" function, but I haven't found it yet.
Can anyone give me any pointers in the right direction as to how I might accomplish this?
Thanks in advance, m...
Comments
custom theme maybe?
Hi, if your form is in your own module then you can override the theme to be used by the module.
In your .module file add a "custom_theme" hook, for example:
This will make Drupal use the Mayo theme for your module. You can of course use any installed (and enabled) theme.
Hi, in your custom module,
Hi,
in your custom module, put this code:
Then, in your site theme folder, create a new file named page-iframe.tpl.php and put there only the variables that you need from page.tpl.php.
Don't forget to clear the cache after you implement the preprocess hook!
Vasi.
code in comments
Hi Vasi, not sure if you know, but when commenting you can put the normal php opening and closing tags inside the code and /code tags and it will show up nicely coloured..
CSS implications
Neat solution from Vasi, and you could also use that approach for other conditions such as specific templates for certain nodes, i.e. use
I tried this approach once as well, but found I was still stuck with the default theme's CSS, so couldn't change the column layout.