[development] Advice on a menucallback

Ramiro Gómez web at ramiro.org
Wed Jul 11 23:48:51 UTC 2007


Add

print theme('page',$content);

at the end of your rockstanza_list_creative() function.
> Hi,
>
> I'm trying to get a very small module running - I have a menu callback which 
> generates a blank page on activating the callback. I'm basing this heavily on 
> the onthisdate exemplar module on the drupal.org
>
> I point my browser at ?q=list_creative/T and receive an empty page.  Can 
> anyone advise me on what I'm doing wrong? Apologies if this should have been 
> posted to support instead of development.
>
> Cheers
>
> Chris
> /** Group creative posts (e.g. poems) by the first letter of their title
>  *  use via menu callback
>  * @returns content HTML 
> */
> function rockstanza_list_creative($firstletter) {
> 	$fl = '^'.$firstletter[0];	
>
> 	//get all poems with chosen first letter of title
> 	$result = db_query(db_rewrite_sql(
> 		"SELECT n.nid, n.title, n.type " .
> 		"FROM {node} n " .
> 		"WHERE n.type = 'poem' " .
> 		"AND n.title REGEXP '%s' " .
> 		"ORDER BY n.title ASC", $fl
>      ));
>      
> 	//leave only the node titles in the results
> 	$content = node_title_list($result);
> }
>   


-- 
Ramiro Gómez

Software developer with focus on content management systems,
SEO, and open source.

Websites:
www.ramiro.org
www.seo-expert-blog.com
www.torlaune.de



More information about the development mailing list