Last week I started the challenge to upgrade <a href="http://testedgroup.com" target=_blank">my custom zen sub-theme from zen 5.x-0.7 to zen 5.x-1.0 which has taken a couple more hours effort than I had originally expected. The outcome so far however was worth the effort. Thanks JohnAlbin and contributors.
With the excellent documentation, I have decided to start and modify my frontpage from the traditional river of news to display NODE-X that wraps around BLOCK-X displayed on the right hand side of the content. Now I have hit a barrier and I need your input...
My definitions
- NODE-X
- NODE-X is the most recent node to have been published to the frontpage that has also been marked as "Sticky at top of lists" from the "Publishing options" My goal is that using this conditional selection of NODE-X I can change the frontpage quickly and efficiently.
- BLOCK-X
- BLOCK-X is a simple block created using the views module that displays the titles of the 10 most recent nodes that have been published to the frontpage.
Visually, the new frontpage my web site to look something like this;
Frontpage Regions Created
+-----------------------------+ +-----------------------------+ | LOGO SEARCH | | LOGO SEARCH | +-----------------------------+ +-----------------------------+ | PRIMARY LINKS | | NAVBAR | | | BLOCK | | | | | | NODE-X-TITLE | | | LEFT | FP_TOP | RIGHT | | NODE-X-CONTENT | BLOCK | | | | | | VIEWS | | | | FP_C | | | BLOCK | BLOCK | | | | | | | | | | FP_L FP_R| | | | | | | | | | | | | | FP_B | | | | | | | | | +---------------------+-------+ +---------------------+-------+ | FOOTER | | FOOTER | +-----------------------------+ +-----------------------------+
Where FP = frontpage
I have a few ideas for this and hope to get some input from the zen community on;
What I have done so far...
Modify my template.php file to include new regions.
function fire_regions() {
return array(
'left' => t('left sidebar'),
'right' => t('right sidebar'),
'navbar' => t('navigation bar'),
'content_top' => t('content top'),
'content_bottom' => t('content bottom'),
'header' => t('header'),
'footer' => t('footer'),
'closure_region' => t('closure'),
'frontpage_top' => t('frontpage top'),
'frontpage_centre' => t('frontpage centre'),
'frontpage_centre_left' => t('frontpage centre left'),
'frontpage_centre_right' => t('frontpage centre right'),
'frontpage_bottom' => t('frontpage bottom'),
);
}Note: In this case, I have added the new regions prefixed with frontpage_.
Added the new regions to page.tpl.php as follows;
<?php if ($is_front || strstr($_GET['q'], 'admin/block')) : ?>
<div id="frontpage_top" class="frontpage">
<?php print $frontpage_top ?>
<?php print $frontpage_centre ?>
</div>
<div id="frontpage_centre_left" class="frontpage">
<?php print $frontpage_centre_left ?>
</div>
<div id="frontpage_centre_right" class="frontpage">
<?php print $frontpage_centre_right ?>
</div>
<div id="frontpage_bottom" class="frontpage">
<?php print $frontpage_bottom ?>
</div>
<?php endif; ?>Note: These new regions ONLY show up on the front page because of this condition: <?php if ($is_front || strstr($_GET['q'], 'admin/block')) : ?>
I have also added the following I have also added the corresponding CSS to position the content.
My problem
I have got most things ok so far but I can't get the NODE-X published to the frontpage and to have it wrap around my new BLOCK-X. I can get BLOCK-X to display ok, but I can't display the full content of NODE-X..
As of the March 2, you can see my problem here... http://testedgroup.com
The opportunity
If we can get this right, perhaps we might be able to change the way drupal looks for a default installation to something that may be more traditional for most users.

Comments
NODE-X Found!
Woo hoo..
Here is the code I have been looking for to only show
$list_qtynode(s) that are promoted to the front page and are sticky;<?php
/*
* [RPORT] This PHP snippet displays NODE-X where the node meets the criteria;
* n.promote = '1' - this is a node that is promoted to the front page AND;
* n.sticky = '1' - this is a node that is marked as sticky.
*/
$list_qty = 2;
$sql = "SELECT n.nid, n.vid, n.type, n.created, r.body, r.format FROM {node} n INNER JOIN {node_revisions} r ON r.vid = n.vid WHERE n.promote = '1' AND n.sticky = '1' ORDER BY n.created DESC";
$result = db_query_range(db_rewrite_sql($sql), 0, $list_qty);
while ($node = db_fetch_object($result)) {
// print your markup here
print check_markup($node->body, $node->format, false);
}
?>
The way I use this is to place the latest news (promote but not sticky) on the right hand side of my frontpage.
Hope this helps someone.
Russ