Reputation: 585
Hi Everyone I am new to drupal and i am working on drupal theming i have created my own modules which have textfields and javascript validation in it. Now i am trying to create own theme for my module but i am not getting how to do can anyone pls give me a idea of how to do from basic or any links which explains in detail from scratch. thanks in advance.
Upvotes: 0
Views: 110
Reputation: 33275
You don't create themes for modules, themes are made for an entire site which will have several modules enabled.
If you want your module to be themable, that is, make it easy to alter the markup it generates, you will have to use the drupal theme system.
For the most part, when your module needs to generate some markup, you need to use the theme()
function.
Sometimes you will need to create some custom markup which there is no theme function for. If that is the case, you will need to register your theme functions, so Drupal know they are there and so themes can overwrite them if needed. This is done with hook_theme()
.
There is a guide for developers on how to use the theme system.
Upvotes: 3
Reputation: 12157
Hook_theme() is used to define your modules theme implementations.
This looks like quite a good overview.
Upvotes: 0