Ask expert: How to create a block which is include many pages?

stephenyam - October 18, 2008 - 19:51

Hi guys,

Let's me explain this complex trouble:

I have folder "Check PR BL", this one include some pages like: "index.php", "check.php"...And page: "index.php" has some text box for input.
Now, i want these text box appear on Region: "User 1" of my Drupal page.
I try to use "CCK Block" but when add code of "index.php", that appear HTML only. See: http://www.phantichweb.com.
In Joomla, i can use a "Custom content module" to add code of "index.php", very simple. But now, i do not know how to do it. Please help me to solve this!

Thank you so much!
Stephen

In the admin/build/modules

cog.rusty - October 18, 2008 - 20:10

In the admin/build/modules page, enable the "PHP filter" module.

Then, when you edit a block choose the "PHP code" input format.

Still can not solve my problem!

stephenyam - October 19, 2008 - 05:40

Hi guys,

Thanks for your response. But my problem may be not only stop at there. After research some topics in forum, i think may be i must to create a module for myself. Some of my question are:
1. Are there any document guide HOW TO CREATE A MODULE?
2. How to add that module to a block? I knew how to create a block but do not know how to embed a module to it.

Thank you so much to all of you!
Stephen

1. did you even try to look?

WorldFallz - October 19, 2008 - 06:19

1. did you even try to look? Documentation -> Developing for drupal -> Module developer's guide

2. Modules aren't embedded into blocks. Modules can create blocks. Read the module developer's guide and it should become clearer.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

What Joomla calls a "module"

cog.rusty - October 19, 2008 - 11:18

What Joomla calls a "module" is what Drupal calls a "block".

What Drupal calls a "module" is what Joomla calls a "component" or a "mambot". Some software which does various things at various places.

So, technically, you don't add a Drupal module in a block or in any specific place. You write a Drupal module which *creates* a block.

There is extensive documentation about how to write a Drupal module at the handbook section which WorldFallz pointed out.

Another option, if adding php in a block does not handle your php code the way you want, consider running your php files in an iframe. See for example the http://drupal.org/project/insertframe module.

Problem is solved!

stephenyam - October 21, 2008 - 03:14

hi all,

Thanks for all, i understood already. My problem is solved by using insertframe module.

Regards,
Stephen

mambots is hot!

zilla - October 21, 2008 - 04:38

that's a cool name, adds way more sex appeal (as in, "dude, have you seen her site? she has serious mambots")

drupal needs that kind of sex appeal, and hence i propose renamed blocks to "drunads"

........................................................................
i love to waste time: http://twitter.com/passingnotes

That's the funniest thing I

gforce301 - October 21, 2008 - 04:50

That's the funniest thing I have read on here in a long long time. I almost fell out of my chair.

+1 for renaming blocks to "drunads"!!

 
 

Drupal is a registered trademark of Dries Buytaert.