| 1 |
<?php // $Id: flexiblock.module,v 1.2 2005/07/23 01:03:19 djnz Exp $ |
<?php // $Id: flexiblock.module,v 1.3 2005/07/23 23:12:44 djnz Exp $ |
| 2 |
|
|
| 3 |
/** |
/** |
| 4 |
* @file |
* @file |
| 8 |
|
|
| 9 |
/** |
/** |
| 10 |
* @usage |
* @usage |
| 11 |
|
* For PHPtemplate themes adapt the example below (remove the space from ? > of course) |
| 12 |
* 1) Generate a simple sidebar. Useful if you just want an extra sidebar, or |
* 1) Generate a simple sidebar. Useful if you just want an extra sidebar, or |
| 13 |
* for regions with a single block |
* for regions with a single block |
| 14 |
* <?php theme('flexiblock_html', 2) ? > |
* <?php theme('flexiblock_html', 2) ? > |
| 15 |
* |
* |
| 16 |
* 2) Generate blocks one by one for a region. Useful for including code between |
* 2) Generate blocks one by one for a region. Useful for including code between |
| 17 |
* blocks e.g. to lay them out in a horizontal table. |
* blocks e.g. to lay them out in a horizontal table. |
| 18 |
* <?php $blocks = theme('flexiblock_blocks', 2); |
* <?php $blocks = theme('flexiblock_blocks', 2); ? > |
| 19 |
* foreach ( $blocks as $block ) { |
* <?php foreach ( $blocks as $block ) { ? > |
| 20 |
* echo theme_block((object)$block); |
* <?php echo theme_block((object)$block); ? > |
| 21 |
* } |
* <?php } ? > |
|
* ? > |
|
| 22 |
* |
* |
| 23 |
* 3) Total control over layout of individual blocks within a region. |
* 3) Total control over layout of individual blocks within a region. |
|
* <?php $blocks = theme('flexiblock_blocks', 2); ? > |
|
| 24 |
* <?php foreach ( $blocks as $block ) { ? > |
* <?php foreach ( $blocks as $block ) { ? > |
| 25 |
* <h3><?php $block.subject ? ></h3> |
* <h3><?php echo $block['subject'] ? ></h3> |
| 26 |
* <?php $block.content ? > |
* <?php echo $block['content'] ? > |
| 27 |
* <?php } ? > |
* <?php } ? > |
| 28 |
* |
* |
| 29 |
* Note that flexiblock is integrated into wgSmarty which makes it even simpler |
* Note that flexiblock is integrated into wgSmarty which makes it even simpler |