Hello I am trying to create a custom page-front.tpl.php. I have successfully overcome the first hurdle of figuring out how to set a template for the main page. I have my own custom static elements displaying properly. Now to the dynamic content... I have three goals:

1. Display the single most recent node of the POTD (product of the day) CCK type I created.
2. Display the "Recent threads/posts" that the Drupal vB module creates
3. Display a single most recent Blog post

In trying to get this to work, so far I have made two regions in the template's .info file as follows:

region[fppotd] =  Front Page Product of the Day
region[fpkfsblog] = Front Page Latest KFS Blog Entry

I found this article which described how to output the regions in the pages, but none of what it suggests works.

http://drupal.org/node/359021

I have been able to successfully use the Views module to create a block/node that only displays the single most recent published POTD, but I have NO IDEA how to get that block to be displayed on my page-front.tpl.php

When I go to the blocks page, I don't see these regions I described above as available to put things into. I suspect this is because the system thinks those regions are for page.tpl.php. How do I differentiate the two? This seems like it should be easy but I've been banging my head against this particular hurdle for three hours now today.

Any links to documentation/tutorials/resources on the regions & blocks system would be great, I haven't been able to find any info about how to accomplish this stuff in the *.tpl.php pages, only through the admin menu.

Comments

zbricoleur’s picture

Are you printing the $fpkfsblog variable in the page-front.tpl.php?

<?php print $fpkfsblog ?>

Also, you may need to clear the theme registry. On the "Administer > Site configuration > Performance" page, click on the "Clear cached data" button.

DirtyBirdNJ’s picture

Yes, I have tried this. There is some placehoder content in the div from when I was developing the layout, here is the code from the template:

             
						<div id="potd_box">
						   
						   <?php print $fppotd ?>
						   <h1 style="text-align: center">KFS Deal of the Day</h1>
						   <img src="images/aquaskinztest.jpg" width="171" height="170" alt="Aquaskinz Large Pouch"/>
						   <h2>Aquaskinz Large Pouch</h2>
						   <h4>Regular Price: $23.00</h4>
						   <h3 style="font-weight: bold; color: #FF0000">TODAY ONLY Price: $23.00</h3>
						</div>

Here is what that code outputs:

<div id="potd_box">
						   
						   						   <h1 style="text-align: center">KFS Deal of the Day</h1>
						   <img src="images/aquaskinztest.jpg" width="171" height="170" alt="Aquaskinz Large Pouch"/>
						   <h2>Aquaskinz Large Pouch</h2>
						   <h4>Regular Price: $23.00</h4>
						   <h3 style="font-weight: bold; color: #FF0000">TODAY ONLY Price: $23.00</h3>   
						</div>

The Blocks page shows the block that I created through views, but the dropdown list only offers 5 region options:

  • Header
  • Footer
  • Content
  • Left Sidebar
  • Right Sidebar

Very confusingly, none of those are defined in my .info file... here's the whole thing:

; $Id: kfstpl.info, v1.1 Mat Gilbert 12/3/08

name = Kfstpl
description = Custom Drupal 6 Theme for KayakFishingStuff.com
screenshot = screenshot.png
core = 6.x
engine = phptemplate

scripts[] = time.js

region[ad_header] = Header Ad Space
region[ad_abcontent] = Above Content Ad Space
region[ad_skyscraper] = Right Side Skyscraper Ad Space
region[ad_footer] = Footer Ad Space

region[fppotd] =  Front Page Product of the Day
region[fpkfsblog] = Front Page Latest KFS Blog Entry
zbricoleur’s picture

Ah, I see the problem; should have spotted it sooner.

region[ad_header] = Header Ad Space
region[ad_abcontent] = Above Content Ad Space
region[ad_skyscraper] = Right Side Skyscraper Ad Space
region[ad_footer] = Footer Ad Space

region[fppotd] =  Front Page Product of the Day
region[fpkfsblog] = Front Page Latest KFS Blog Entry

needs to be

regions[ad_header] = Header Ad Space
regions[ad_abcontent] = Above Content Ad Space
regions[ad_skyscraper] = Right Side Skyscraper Ad Space
regions[ad_footer] = Footer Ad Space

regions[fppotd] =  Front Page Product of the Day
regions[fpkfsblog] = Front Page Latest KFS Blog Entry

Note the difference between 'region[' and 'regions[' ;-)

And you should probably leave the default regions in there, too.

DirtyBirdNJ’s picture

AWWWW!! Are you kidding me? This feels like an ice cream headache of shaaaaame! Totally RTFM :(

Probably an easy mistake to make, but a noob mis-step none the less.

Adding an "s" to each line of code confidently clears this hurdle. Now to get Devel working properly!