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.
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
Are you printing the
Are you printing the $fpkfsblog variable in the page-front.tpl.php?
Also, you may need to clear the theme registry. On the "Administer > Site configuration > Performance" page, click on the "Clear cached data" button.
Yes, I have tried this. There
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:
Here is what that code outputs:
The Blocks page shows the block that I created through views, but the dropdown list only offers 5 region options:
Very confusingly, none of those are defined in my .info file... here's the whole thing:
Ah, I see the problem; should
Ah, I see the problem; should have spotted it sooner.
needs to be
Note the difference between 'region[' and 'regions[' ;-)
And you should probably leave the default regions in there, too.
AWWWW!! Are you kidding me?
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!