Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7609721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:14:30+00:00 2026-05-31T01:14:30+00:00

I have created a Block… and am displaying a node (loading a node in

  • 0

I have created a Block… and am displaying a node (loading a node in it).

function my_module_block_info() {
  $blocks = array();
  $blocks['my-block-id'] = array(
    'info' => t('Block Name'),
  );
  return $blocks;
}

function my_module_block_view($delta='') {
  $block = array();
  switch ($delta) {
    case 'my-block-id':
      $block['subject'] = t('Block Name');
      $block['content'] = my_module_contents();
      break;
  }
  return $block;
}

function my_module_contents() {
  return 'iframe width="560" height="315" src="http://localhost/try/node/27" frameborder="0" allowfullscreen /iframe';
}

As am using iframe so it renders all the content on the page but I want to display only the NODE Content in block, I don’t want the header, menu, and footer to appear in the block.

Below is the image, thanks

enter image description here

Update :

If I implement node_view as per below code the node does get rendered as a full node but this only works if your block is on a node if the block is on another path say admin/structure/nodequeue then it does not work. So how can I make this work on such a path ? Pls help

function my_module_contents() {
 return drupal_render(node_view(node_load(27), 'full'));
}

FINAL SOLVED SOLUTION *

Below is the code which worked. Thank you laxman for your help

function customvishal_block_info() {
 $blocks = array();
 $blocks['my-block-id'] = array(
'info' => t('Block Name'),
 );
 return $blocks;
 }

 function customvishal_block_view($delta='') {
 $block = array();
 switch ($delta) {
  case 'my-block-id':
  $block['subject'] = t('Block Name');
  $block['content'] = my_module_contents();
  break;
  }
  return $block;
  }

 function my_module_contents() {
 $customvishalfull= drupal_render(node_view(node_load(155), 'full'));

 // print_r($customvishalfull);
 // Example of creating and calling "strike" theme function.
 $output .= '<h2>Custom "strike" theme function</h2>';
 $output .= theme('customvishal_strike', array('string' =>$customvishalfull));


 return $output;

 }





function customvishal_theme() {
 return array(
 'customvishal_strike' => array(
  'variables' => array('string' => array()),
    'template' => 'property',
 ),
 ); 
 }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T01:14:31+00:00Added an answer on May 31, 2026 at 1:14 am

    Since you are using the iframe, it will load the entire page as you have experienced. Consider using drupal_render(), node_load(), and node_view() to display only the node information. You
    could change my_module_contents() to:

    function my_module_contents() {
      return drupal_render(node_view(node_load(27), 'full'));
    }
    

    You could also change ‘full’ to ‘teaser’ to show the teaser of the node.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a simple web browser using c# and I want to block
I am having a problem using the Unity Application Block, I have created a
I'm a drupal newbie... I have created a block with View Module to list
i have created a list_home.phtml that i call from {{block type=catalog/product_list category_id=6 template=catalog/product/list_home.phtml}} The
I am creating a custom module in magento.I have created block class and phtml
I have a Block created by a View that outputs the 5 latest posts
we have created following anonymous block........... DECLARE sql_str long(32000); where_str long(32000); counter NUMBER(3):=0; BEGIN
I have created a small game, in which some blocks are move around a
We have created an invite function at our site in JavaScript using the Graph
I have created a query block with begin/end and want to run that in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.