adding to blocks based on module

macieq - December 28, 2008 - 02:11

Hi everyne!

Im wondering about how to add something to every blocks but without ingeration to block.tpl.php
I want to write some module for defferent themes and I started with one and this work (but not module)
I add to template.php:

function marinelli_preprocess_block(&$vars, $hook) {

...
$vars['$generated_content'] = '...';
}

and it works when I add

<?php
print $generated_content
?>
to block.tpl.php

but how can I do this with adding module? Thx for helping.

I started

macieq - December 29, 2008 - 11:17

I started with:

mymodule_preprocess_block(&$vars, $hook) {

...
$vars['$generated_content'] = '...';
}

And it works but only when i put the

<?php
print $generated_content
?>

in block.tpl.php

My question:
How to add something to all blocks on page. I tried to change in:

$vars[...] but there is stdClass which couse this problematic and I don't know how to do that. Im a little bit closer...

---
Nothing is impossible, exept that we can imagen or see.

okey - done

macieq - December 29, 2008 - 13:13

Okey. Its done. I simply added at the end of function the:
$block->content .= $vars['edit_links'];
and it works.

If enybody is interested in this module write to me.

This module is to display "edit block" and "conf block" and "edit menu" links to every block, menus. You don't have to go to administration pages and search for editing. Simply this links are in blocks and shows to admins who have perwmissions to edit blocks, menus etc.

Nothing is impossible, exept that we can imagen or see.

Better

macieq - January 3, 2009 - 02:07

My module is better then Block Edit module. My module works on every themes, the Block Edit module is not.

 
 

Drupal is a registered trademark of Dries Buytaert.