[development] how to create channel based template callback
Wang Zi Feng
frank.zifeng at gmail.com
Thu Oct 1 06:49:54 UTC 2009
Hi Andrew, thanks for your instruction.
I tried what you suggested. by using modulename_preprocess_page() theme
hook, different template page.tpl.php file could be implemented by different
Could you also see the code for me, I wonder if any better way to get same
the hook_menu path is games, and it will invoke page-games.tpl.php when
visit ?q=games link.
$suggestions = 'page-games';
THanks for your kind help
2009/9/28 andrew morton <drewish at katherinehouse.com>
> I'm not totally clear what you're trying to do but it seems like you
> could use a preprocess hook (e.g. modulename_preprocess_page()) to
> alter the 'template_files' variable that the theme system uses to find
> candidate files. I'd suggest reviewing the code in
> template_preprocess_page() to see how the list of candidates is
> On Mon, Sep 28, 2009 at 3:34 AM, wang zifeng <frank.zifeng at gmail.com>
> > Hey Guys, first I am new to drupal development and try to learn
> > 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
> > members with their avatars triggering by hook_menu ‘?q=blog’ path.
> > I write the code as what the drupal module development guide taught,
> > 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
> > 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
> > into ‘contents’ region finally and placed into the template file. In
> > words, I can’t change the variable into other region, so that let me
> > 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
> > 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,
> > can I do. Like creating customized channel by ?q=video or ?q=game.
> > Thanks
> > Frank
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the development