[development] how to create channel based template callback

wang zifeng frank.zifeng at gmail.com
Mon Sep 28 07:34:04 UTC 2009


Hey Guys, first I am new to drupal development and try to learn everything
about drupal by scratch. My questions might be easy to you but still hard
for me, so any reply is welcomed and appreciated.

Recently, I am going to create a customize module that to show all the blog
members with their avatars triggering by hook_menu ‘?q=blog’ path.

I write the code as what the drupal module development guide taught,  first
to use hook_menu to route the path as well as the callback function, then
use hook_theme to state the template, and then use theme() function in the
customize function to call template, last is use template_preprocess
function to create the variables before it pass to template file.

But I found, all the variables that passed to the template file was packed
into ‘contents’ region finally and placed into the template file. In other
words, I can’t change the variable into other region, so that let me create
a fully customize template for a specific path.

For a clearer understanding of my problem:

For example, like the difference between page.tpl.php and
page-front.tpl.php, the second one could be fully customized with regions.

 If I want to call page-blogmember.tpl.php trigger by ‘?q=blogmember ‘ to
show all the blog avatars but with a fully customized region template, how
can I do.  Like creating customized channel by ?q=video or ?q=game.

Thanks

Frank
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.drupal.org/pipermail/development/attachments/20090928/36489d9e/attachment-0001.htm>


More information about the development mailing list