I am trying to create a special template page for a group of pages by following Creating a page.tpl.php template for a group of pages (Drupal 7)
I created a page--sales.tpl.php file
<div id="page-wrapper">
<div id="page">
<?php if (isset($page['header'])) : ?>
<?php print render($page['header']); ?>
<?php endif; ?>
<?php if ($breadcrumb): ?>
<div id="breadcrumb"><?php print $breadcrumb; ?></div>
<?php endif; ?>
<div id="main-wrapper">
<div id="main" class="clearfix">
<?php if (isset($page['content'])): ?>
<?php print render($page['content']); ?>
<?php endif; ?>
</div>
</div>
<div id="footer">
<div class="section">
<?php if (isset($page['footer'])): ?>
<?php print render($page['footer']); ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
And my content template looks like
<table>
<tbody>
<tr>
<th><h3> <?php print t('Sale Order ID') ?></h3></th>
<th><h3> <?php print t('Date | Time') ?> </h3></th>
<th><h3> <?php print t('Download File') ?> </h3></th>
</tr>
<?php foreach ($sale_orders as $sale_order): ?>
<tr>
<td> <?php print $sale_order['sale_order_id'] ?> </td>
<td> <?php print $sale_order['sale_order_date'] ?> </td>
<td> <a href="<?php print $GLOBALS['base_url'] . '/sales/download/' . $sale_order['account_download_id']; ?>">
<?php print $sale_order['file_name'] ?> </a>
</td>
</tr>
<?php endforeach; ?>
</table>
I assumed that the sidebar won't show, because in page--sales.tpl.php does not render $page['sidebar_first']. But I found that as soon as I render $page['content'], I will get the side bar contents as well.
I think my problem is not understanding how $page['content'] is generated. Do other parts such as breadcrumb and sidebar get "embedded" into $page['content'] before the the page--sales.tpl.php file get processed?
Thanks for your help.