I am trying to get an adsense block to appear right under "Submitted by {name} on {date}" and I keep trying to edit my node.tpl.php file and I can't even get it to show up within the node. I even checked FireBug to see if the div was there, it wasn't.

Here is a copy of my node.tpl.php file:

<?php // $Id: node.tpl.php,v 1.3 2008/08/21 21:58:40 jmburnz Exp $ 
/**
 * @file node.tpl.php
 *
 * Theme implementation to display a node.
 *
 * @see template_preprocess()
 * @see template_preprocess_node()
 */
?>
<div class="node <?php print $node_classes; ?>" id="node_<?php print $node->nid; ?>">
  <?php if ($page == 0): ?>	
    <h2><a href="<?php print $node_url; ?>" rel="bookmark"><?php print $title; ?></a></h2>
  <?php endif; ?>		
  <?php if ($unpublished): ?>
    <div class="unpublished"><?php print t('Unpublished'); ?></div>
  <?php endif; ?>
  <?php if ($submitted): ?>
    <h4 class="meta"><abbr title="<?php print format_date($node->created, 'custom', "l, F j, Y - H:i"); ?>"><?php print format_date($node->created, 'custom', "F j, Y"); ?></abbr> <?php print t('by'); ?> <em><?php print $name; ?></em></h4>
  <?php endif; ?>
  <?php if(!empty($picture) && ($node->type != 'poll')): ?>
    <div class="picture">
      <?php print $picture; ?>
    </div>
  <?php endif; ?>
  <div style="display:block;float:left; margin: 5px 10px 5px 10px;">
  <script type="text/javascript"><!--
       google_ad_client = "pub-6000000000000000";
       /* Comment */
       google_ad_slot = "0000000000";
       google_ad_width = 336;
       google_ad_height = 280;
       //-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
  <?php print $content; ?>
  <?php if ($page == 1): ?>
    <h5 class="permalink"><a href="<?php print $node_url; ?>" rel="bookmark"><?php print t('Permalink'); ?></a></h5>
  <?php endif; ?>
  <?php if (count($taxonomy)): ?>
    <div class="tags"><?php print $terms; ?></div>
  <?php endif; ?>
  <?php if ($links): ?>
    <div class="actions"><?php print $links; ?></div>
  <?php endif; ?>
</div> <!-- /node -->

Any help on how to go about doing this would be helpful.

Thanks.

Comments

bsherwood’s picture

I also tried following:

http://www.codegobbler.com/drupal-6-how-embed-region-node

But I still can't get a block within a node.

I followed the instructions above with another theme and it worked. Does newswire handle this differently?

bsherwood’s picture

Title: Adding Adsense to node.tpl.php? » Add region to node.tpl.php
Jeff Burnz’s picture

Nothing special going on in Newswire - you might want to double check the modified node.tpl.php file is actually on the server, if you print a big chunk of JavaScript such as a Google Adsense ad then it will show up if the template is being correctly pulled (you haven't by any change added a node type specific template that you forgot about?).

bsherwood’s picture

Status: Active » Fixed

Apparently, Organic Groups overrides node.tpl.php when using content types that are associated with it. I had to change node-og-group-post.tpl.php under sites/all/modules/og/theme to get it to show up on group content types.

barry’s picture

Apparently, Organic Groups overrides node.tpl.php when using content types that are associated with it. I had to change node-og-group-post.tpl.php under sites/all/modules/og/theme to get it to show up on group content types.

You would be better off copying the node-og-group-post.tpl.php in to your theme directory. That way you won't need to make the change every time you update the organic groups module.

bsherwood’s picture

I didn't know you could do that!

Thanks for the tip.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.