User login

Putting regions and blocks in Drupal nodes

Searched words: 
Drupal block regions in nodes

Regions in blocks from Lullabot as interpreted by Morton:

übermucho more fun with regions in nodes

Ohh and another little thing i found over at the lullebot site (eaton you are a hero!) adding regions inside the node - damn that have been a lifesaver the last couple of weeks.
So just if i ever ever ever forgets it - heres the snip (and now no more absurd css trix margin: -666px 0 0 0)
add a region

function foo_regions() {
return array(
'foo_region' => t('foo region'),
'bar_region => t('bar region'),
);
}

in the _phptemplate_variables() put this little baby:

//BLOGS -> NODE
// the region:
if ($vars['page'] == TRUE) {
$vars['foo_region'] = theme('blocks', 'foo_region');
$vars['bar_region'] = theme('blocks', 'bar_region');
}

And now by sweet magick $foo_region & $bar_region is available for the node.tpl.php
and we are at it with the theming tricks:
Kick the $styles and add the needed one by hand -thats the only way to avoid the "where did that 1.5em padding came from"

Resolution

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Syntax highlight code surrounded by the {syntaxhighlighter SPEC}...{/syntaxhighlighter} tags, where SPEC is a Syntaxhighlighter options string or "class="OPTIONS" title="the title".
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.