GMgKe586q6suSQnyqZLlGCooeWM

Pages

Search

Friday, March 11, 2011

Drupal - Render Variables

To render a variable from template file to specific tpl tile, you need to declare the variable first in template file
<?php

function ipod_process_page(&$variables){
    $variables['content'] = array(
        '#markup' => '<div id="content">Content Here</div>';
        '#weight' => 100,
    );
}

Then on page.tpl.php, do
<div id="page">
    <?php print render($content);?>
</div>
Share/Bookmark

No comments:

Post a Comment