Please Help any one knows how to create custom blocks. I am unable to find creation of custom block.

Comments

test127’s picture

mani_RK’s picture

Thank you for sending those links.

But In those links there is no custom creation block examples.

Please provide one example for creating own custom block.

aaustin’s picture

The easy way is just to go to your admin blocks section and add a new block.

If your block is very basic, it shouldn't be too difficult. If you need to add code, just use the php code filter and you can access all of the drupal API functions from that code.

A more sustainable and manageable but slightly more difficult way to go about this is to create your own module with all of the custom code for your module.

If you are going to do this, then you will need to understand how to make a module and use the hook_block function.

test127’s picture

What do you want your custom block to do?

mani_RK’s picture

Thanks You for your response.

I need to display uploaded images in the front page. and also I need to one form from backend to upload images and corresponding details. It is possible with block or I need to create module.

If I need to create module, please advice how to create simple module.

dwees’s picture

This doesn't sound to me like you need a module to be created. Here's what you can do.

1. Install the image module (downloadable from this site) and get it working.

2. Install the CCK module (downloadable from this site) and get it working.

3. Use the CCK module to modify the fields of the Image module to suit your needs (this is assuming you are using Drupal 5.x).

4. Publish your images, making sure to choose the option 'Promote to Front page'.

After that it's just a matter of theming your output to suit your needs.