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.
By chiuming07 on
How can I create a Drupal "Page" (not a block) without any theme like the following:
http://www.oniva.com/upload/1356/em.jpg
I would like the page this "Page" in HTML iframe
I do not want this "Page" to include any header / footer / left / right column.
Can to set this update in Drupal?
when i request to Drupal Node like - node/31
then the Page show up without any theme applied.
Comments
Have you looked at...
...Taxonomy Theme? This allows you to apply multiple themes across your website, by defining which page has which theme...
I know you said you were looking for a page with "no theme" but my understanding is that this isn't possible (could be wrong i guess) but you could create an additional theme for your site which is just completely blank, and apply this to the appropriate pages?
Or just create it as plain
Or just create it as plain old html and manage it outside of Drupal completely. It could live in the same directory as Drupal files but not invoke any of the Drupal engine. Instead of the link to it being node/31 it would be .../plain_old_html.html
Custom content type + template
Two options come to mind:
1) Create a new content type, "Iframe page" for example, and define a custom page.tpl.php template for it that does not have any of the regions (Eg: page-iframe.tpl.php).
All it really needs is the html/head/body tags and
echo $content;
2) Add some sort of flag, (ckk, node id, or whatever), that you can detect in page.tpl.php. Then if this is present, simple echo $content and return.
Alan Davison
Also interested
I'm also interested in something like that.
The reason;
I want other webpages be able to display a "iframe" style of a dropdown menu that would pull some data from my website.
e.g. my site is a professional directory, other pages could benefit from my database of professionals and pull results from it.
Any ideas?
Could you explain...
...in a bit more detail, as in would you want elements from your database pulled into an external site to display details of professionals, or to display a full website page within the iframe. I guess you could maye create two themes, one for your actual visitors, and a plain one for when a page is 'pulled' from your site, you could maybe use the taxonomy_theme module in some way, although I'm not sure how you would then determine which theme to apply to a page, based on if it was to be displayed in an iframe or not?
For example; The page at
For example;
The page at www.dealocal.co.uk/bath-and-north-east-somerset displays professionals working in an area (Bath and North East Somerset).
What I'd like to do is another page (new URL of course) that only pulls the "Content" (i.e the view list of the professionals) and nothing else, no blocks, no header, no menus.
I am assuming (because I don't know it for sure) that then I'd be able to use an iFrame to pull that page (or any other for the matter) from any website. Wouldn't I?
I imagine the option suggested by Alan D (above) is what I'll have to go for, it makes sense doesn't it? But I'm not sure how to do it.
Thanks
P.S. I cannot use taxonomy_theme because I'll be upgrading this site to Drupal 6 very soon, don't want to use modules that won't allow me to upgrade it.
I would create an entire new
I would create an entire new theme that is blank, just the header section, $content, and $closure.
You will need a custom module to provide a hook_init to switch themes based on the page request (if there isn't another module like taxonomy theme in both 5 and 6 already).
Cut n paste from http://api.drupal.org/api/file/developer/examples/page_example.module
Then if the hook_init, look for the flag to switch themes. In this example I am looking for a node of type xxx
It could be worth defining your own AJAX page callbacks and doing this all via AJAX. This would remove the need for the iframe
Alan Davison
I'm not a pro ... just an amateur :-(
Wow .... Alan that is far too much for my brain :-s I only have a very (VERY) basic knowledge of PHP (always happy to learn more though :-).
Please correct me if I'm wrong.
When I read your option 1) above. I thought I could use something like this.
I did manage to theme the maintenance page using the advice at http://drupal.org/node/58562#comment-266358 (great advice by the way)
I thought I may be able to use a similar way to theme a custom page (or a whole directory maybe e.g. all the pages within www.example.com/if/ directory would use the theme).
Obviously I'd have to create a new function (within the template.php and new template page e.g iframed.tpl.php)
Any chance of this working? if yes
Any idea of what the function should look like?
K. The other option apart
K. The other option apart from paying someone to do implement this is to do the site upgrade to 6 and to use something like themekey. There are a couple other theme related modules, but this seems to meet your requirements. You will still need to create the blank theme.
Another option, a bit hackish is to create a content type for the pages that go into the iframe. Then in you page.tpl.php paste in the following:
Replace the
if ($node && $node->type == 'blank_page_content_type') :
with your content type that your using to flag the template.Eg: For the standard Drupal Page content type
if ($node && $node->type == 'page') :
Alan Davison
It nearly does the trick :-)
At this time I'm going to use this "another option" until I've got the site upgraded to D6 then I'll look into it again.
I modified a bit the position of the new code, so I can use a separate .css style page exclusive for this page.
Also I changed a bit in node.tpl.php.
In line 10 you got;
I changed it for;
This eliminates the "posted by" which wouldn't make much sense as this form will be seen in someonelses website
Check it out at http://www.dealocal.co.uk/betatest/if/findadea.htm
Thanks a lot Alan :-)
Alan, this thread was very
Alan, this thread was very helpful to me. Forgive me for asking for more on your already generous post.
I'm loading a view from another site (http://staging.geneticalliance.org) in an iFrame here: http://www.diseaseinfosearch.org. I want a completely stripped out view of a view (diseases), which I created (in your words, hackishly!) by adding a blank content type on the GA site (and modifying page.tpl.php to look for that content type, and display only a very bare html page if it finds it).
I'm having trouble, though, when clicking on a term, on also stripping out the site-results page. I've tried several methods -- including created blank tpl.php versions of the views for site_search iFrame and diseases_Iframe and a straight ajax-rendering call -- but can't get anything to work.
Maybe I should stick to my original faked up method: is there a way to add another IF condition to page.tpl.php to also look for the phrase "iFrame" in the URL and load the blank page type if it finds it? even for views or search results?
You can use the iFrame...
...in the way you mention above, its just a case of defining the iframe on any html page and then pulling in the content, in your case a URL
I wonder
Alan, I wonder if I could get the same effect for a view?
:-)
Anythings possible in drupal
Anythings possible in drupal :)
Hard way - custom coding/theming, easy way the Insert View module. Great little module
Alan Davison
easy way the Insert View
Sorry read it fast and missed you were referring to a different module than View.
I'm checking it out.
thanks again
Would this work?
What should I use to achieve the same effect for a view?
maybe this;
<?php if ($node && $node->view== 'my_view_name') :?>
thanks
I hope that you realize that
I hope that you realize that you can control the submitted by info here: index.php?q=admin/build/themes/settings
Alan Davison
I did know but I forgot :-(
I did know but I forgot :-( about this option
I've now taken of the hack in the node.tlp.php
Thanks for that,
exit
Maybe just:
like for ajax requests?
That's it!
I did a chat module for a client and thinking of contributing it. Uses a pop window like IMCE and rather than put the file at the root level, which I have done plenty; that is not going to work for a module that would interest.
You can just create a page.inc file and use module_load_include, but don't return any output for the menu item.
I prefer
I prefer
But thanks! I was looking for exactly this and didn't think of it.
Does this work?
Does this work?
It is the proper way to exit :)
Alan Davison
And it's less typing! Cheers
And it's less typing! Cheers mate.
create a new node and ...............
Create a new node and use a custom theme for that node. You can skip out the header/footer from that. Also you can set a different CSS for that in the same style.css using different naming conventions. Just print only the content in that .tpl.php file of that node type.
If any Help please forward the page details, I will help it out
Create View without css and template...
Hi, I wanted to know if you can create a view without CSS and without the template? I would need to see just a part of my site on Facebook ... facebook app to redirect the path of the view created ...
thanks
The View can be created without using css and templates
Go to the actual Views and edit the view. Now Click on Theme Information, you will find various theme information related to field, display etc. Choose one of the names under the display output(Copy the last name given under that option). Now make a [yourviewdisplayname].tpl.php using that name and upload that tpl page into /sites/all/themes/[yourthemefolder]/. Now under the same folder create page-[yourviewdisplayname].tpl.php again under the same directory without the css included in it.
Please try it and ask if any query.
<?php/** * Implementation of
Then you need to create two empty templates:
html--iframe.tpl.php
<?php print $page ?>
page--iframe.tpl.php
<?php print render($page['content']) ?>
Perfect
Nice solution, works perfectly!
It works!
Thanks @mrded! This worked like a charm!
Sweet Nectar
Yes, this works amazingly (D7), very clever.
If you wish to return your
If you wish to return your content programatically without a theme you can pop this into a raw menu hook callback:
If you use return without render, you'll see a full themed page.
If you return the rendered content, Drupal 7 will simply display it without any surrounding theme.
-
Be the occasion.