Hi Michel!
The CivicSpace theme does this, you might be interested in looking at that block code and adapting it to your needs.
Robin
On 1/24/06, michel ziobudda morelli michel@ziobudda.net wrote:
Hi. I'm making my themes with phpengine. I need to get the varius html-code of the sidebar-left and sidebar-rigth's box. Is There a way ? For the moment I can only do a <? print $sidebar-left ?>, but I want, e.g., to intercept the code of "login" box. Every help is appreciated.
M.
themes mailing list themes@drupal.org http://lists.drupal.org/mailman/listinfo/themes
-- Robin Monks, CSL Web Administrator robin@civicspacelabs.org Public Key: http://shurl.org/key/devlinks@gmail.com ( http://gmking.org, a gamers dream )
----- Fight back spam! Download the Blue Frog. http://www.bluesecurity.com/register/s?user=bW96aWxsYW1hbg%3D%3D
Can you give a little more information on what you need to do? If you are just looking to style the box, CSS might be a better option. Check the source on a generated page to see exactly what classes/ids are applied to the box.
Also, something like this might help: http://drupal.org/node/44596
I wrote it for $content on a page, but I've used a similar technique to break up the side bars into smaller segments.
Good luck,
Mark Fredrickson
From: michel ziobudda morelli michel@ziobudda.net Reply-To: A list for theme developers themes@drupal.org Date: Tue, 24 Jan 2006 12:11:31 +0100 To: A list for theme developers themes@drupal.org Subject: [heur][bcc][faked-from] [themes] HOw to get the box ?
Hi. I'm making my themes with phpengine. I need to get the varius html-code of the sidebar-left and sidebar-rigth's box. Is There a way ? For the moment I can only do a <? print $sidebar-left ?>, but I want, e.g., to intercept the code of "login" box. Every help is appreciated.
M. _______________________________________________ themes mailing list themes@drupal.org http://lists.drupal.org/mailman/listinfo/themes
Mark Fredrickson ha scritto:
Can you give a little more information on what you need to do?
Hi. In my sidebar-left I have "User options" box(create content, logout, etc etc) and "Active forum topics". I need to intercept them (array with 2 row, e.g.) because I want insert them into my complex-css-theme.
Check the source on a generated page to see exactly what classes/ids are applied to the box.
yes yes
I wrote it for $content on a page, but I've used a similar technique to break up the side bars into smaller segments.
How ?
Tnx.
I wrote it for $content on a page, but I've used a similar technique to break up the side bars into smaller segments.
How?
In PHPTemplate, the $content variable passed to page.tpl.php is constructed by passing in nodes to node.tpl.php and then concatenating the results.
The $sidebar_left and $sidebar_right variables are constructed by passing blocks to block.tpl.php and then concatenating those results.
Therefore, if you insert a delimiter (I use HTML comments: <!-- DELIMITER -->) into either node.tpl.php or block.tpl.php you can find it later and break up the $content, $sidebar_left, and $sidebar_right variables using
$an_array = explode($delimiter, $the_variable_tosplit)
As an example, I've used this to create "tables" of blocks using only CSS. I float all the blocks left using CSS, and after every third block I insert a <div> that clears the blocks. The result is an 3 by n table of blocks (where n = total blocks / 3).
I'll create another snippet to show how this works. I don't think I'll have time today, but I'll see what I can do tomorrow.
For what it is worth, I don't think this addresses you earlier request, but I thought I'd post it anyway as I think it is an interesting technique.
-M
Mark Fredrickson ha scritto:
The $sidebar_left and $sidebar_right variables are constructed by passing blocks to block.tpl.php and then concatenating those results.
Therefore, if you insert a delimiter (I use HTML comments: <!-- DELIMITER -->) into either node.tpl.php or block.tpl.php you can find it later and break up the $content, $sidebar_left, and $sidebar_right variables using
I have another solution:
block.tpl.php contain only: <?php global $module; $module[] = $block; ?>
and page.tpl.php contains: <?php global $module; ?>
No need to print $sidebar_*;
:)
In example print_r($module):
Array ( [0] => stdClass Object ( [module] => forum [delta] => 0 [status] => 1 [weight] => 0 [region] => 0 [custom] => 0 [throttle] => 0 [visibility] => 0 [pages] => [types] => [subject] => Active forum topics [content] => <div class="item-list"><ul><li><a href="?q=node/12">Primo topic</a></li></ul></div><div class="more-link"><a href="?q=forum" title="Read the latest forum topics.">more</a></div>
)
[1] => stdClass Object ( [module] => forum [delta] => 1 [status] => 1 [weight] => 0 [region] => 0 [custom] => 0 [throttle] => 0 [visibility] => 0 [pages] => [types] => [subject] => New forum topics [content] => <div class="item-list"><ul><li><a href="?q=node/12">Primo topic</a></li></ul></div><div class="more-link"><a href="?q=forum" title="Read the latest forum topics.">more</a></div> )
[2] => stdClass Object ( [module] => user [delta] => 1 [status] => 1 [weight] => 0 [region] => 0 [custom] => 0 [throttle] => 0 [visibility] => 0 [pages] => [types] => [subject] => pupabz [content] => <div class="menu"> <ul> <li class="collapsed"><a href="?q=node/add">create content</a></li> <li class="leaf"><a href="?q=user/2">my account</a></li> <li class="collapsed"><a href="?q=admin">administer</a></li> <li class="leaf"><a href="?q=logout">log out</a></li>
</ul> </div> )
)
Bye. Michel.