hey everybody :) i'am very newbie in Drupal. I've to learn making new module from scratch. The question is, how to just fill _block hook in a block without making new module. is it possible? So, i no need configuring menu from administer, no need submitting. I Just need showing some data in the rightsidebar for example.

Thank you :)

Comments

dman’s picture

For that to work, you really do need to make a module, with a .info file and a hook_help. It's easy.

BUT

a short-cut I'm using is to make a normal block-block using the block administrator and using it as a placeholder for my real code.

- create a normal text block block.
- Add text to it called just PLACEHOLDER
- Place that block on your page, and find out its ID. eg, block-block-3
- create block-block-3.tpl.php in your theme
- You CAN copy the contents of block-tpl.php to give you a start there, but it's not required.
- instead, just go wild with your code there

block-block-3.tpl.php

print "I can put any code here";
print_r($variables);

You can do most of what you want there, although there are a few limitations, and the code runs quite late in the page-build process, it's pretty good for many smaller-than-module-sized code things.

... Or you can try doing it in the php field of the block editor, but that's not much fun to edit.

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

polutan’s picture

woww awesome! thank you dman :) very very thank you ! your solutions works! Now i can create a block without making any module first. And now i'am so happy coz now i know mean of block actually :D

thanks bro.. :)