By cafewebmaster on
I need a module, which should send just its self output, also nothing from Drupal core or other modules. No header, no footer, no sidebars-blocks etc...
Example:
It must just print "Hello World", nothing else from header, footer, blocks etc
Let say I have a captcha module and I just want to print an image to screen also no-html code.
How can I do that?
Comments
Are you creating the module?
Are you creating the module? If not what is the source of the output?
Yes, I want to create a
Yes, I want to create a module which prints just "Hello World" nothing else. No output from any module or Drupal core.
You will need a module that
You will need a module that implements hook_menu() and a callback function. See http://drupal.org/node/206753 for a tutorial on creating modules. You need to read at least 1, 2, 3, 8 and 9. 8 covers the callback function, 9 hook_menu (also talked about in 7).
To just print "Hello World" the one difference from the tutorial you want to implement is that in step 8 the callback function returns the output, you want your callback function to print the output.
I have already read module
I have already read module docs and developed a hello_world module. The problem is I see left and right blocks and header-footer too. For example this module should print a demo javascript page, means just module content should transferred to browser nothing from blocks etc. I dont want to disable blocks or change template for whole site.
ie: I want to prevent that ..< html >< head >... appears twice on that page
there's no normal way to do
there's no normal way to do it ..but there are many hacker ways to do it ...
say ..follow the "site is off-line" way.
Make another "off line" module. Then u will have the only the output from your module but NOT from others (i.e. header, footer, sidebars..etc)
another option:
set the css style "display:none" to all you div u dont want to see.
But u may have to do it one by one for all div u dont want to see.
have a nice weekend.
What does your module look
What does your module look like?
If I want to show users a
If I want to show users a html-demo of a menu or any code etc, I cant do it with Drupal's node/add. It will be printed as $content, also subcontent of a Drupal page. But I want to print exactly what code you see in this menu, nothing else.
http://www.cafewebmaster.com/demo/css-menu/dropdown_web2_style.html
I know this thread is old,
I know this thread is old, but in case anybody else needs this.
1. Create a file called page-node-simple.tpl.php and add the following code:
2. On your page.tpl.php add this above everything else:
3. Create a new page and put your HTML in the body field (don't forget to select full HTML or PHP code as input format)
4. Access your newly created node with /node/[your node id]?format=simple
--
http://webdots.ro
Hi Stefan, Thanks very much
Hi Stefan,
Thanks very much for your quick and easy solution! I have just tried it and it works great. I really expected to have to create a whole new sub-theme, or add large amounts of code.
I am happy now. :) I'm glad you decided to post on the thread even though it's really old.
Thanks.
Thanks Stefan x2
Just thought I'd post this code has saved me from hours of coding and unneeded overhead. This was brilliant!
You can also achieve this
You can also achieve this without code by using the display suite module which allows you to add any number of build modes and use them in both views and panels.
Problem in Drupal 7
I am getting a page with just "Array" in Drupal 7.
Is there something wrong that I am doing?
I am now trying to apply this
I am now trying to apply this to D7 and it's working wonderfully, other than an error message on every page:
Notice: Undefined index: format in include() (line 3 of sites/all/themes/at_mono/templates/page.tpl.php).The line this refers to is
Does it need to be modified for D7, or does something else need to change? Thanks for any tips.
It's not a Drupal thing, it's
It's not a Drupal thing, it's a PHP thing. You are checking if $_GET['format'] is equal to something, but $_GET['format'] doesn't exist in the first place, so it cannot be checked. This throws up a PHP warning, which is what you are seeing.
You can change it to this to get rid of the warning:
Contact me to contract me for D7 -> D10/11 migrations.
not working
I had execute your code nut it is not working
it show just "Array" print on page
In case you are creating a custom page.
In case you are creating a custom page and want this to be loaded through ajax callback.
All you need to create a tpl file in your theme named page--UR_MENU_NAME.tpl.php
and write the html with required content only.
Normally you can have your page related data through $page variable.
like if you want to load only returned content of your custom page. just print $page['content']
clear the cache and reload the page. you are done.