Ad sprinkling for Drupal 4.7

PHPTemplate for Drupal 4.7 doesn't use $seqid anymore, as it did in the Drupal 4.6 version when the PHPTemplate engine was just a contrib file. Now $seqid is just $id. That means if you want to sprinkle ads on your index page after the 2nd and 6th nodes, you do something like this at the bottom of your node.tpl.php:

// regular node content up here
<?php if (!$page && ($id == 2 || $id == 6)): ?>
// ad code
<?php endif; ?>


» deekayen's blog · Delicious · Digg · Technorati Topics: ·

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • Allowed HTML tags: <hr /> <a> <p> <em> <strong> <cite> <code> <blockquote> <ul> <ol> <li> <dl> <dt> <dd> <div> <img> <h1> <h2> <h3> <h4> <h5>
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options