I have created a question node type using CCK and would like to show all of the questions which users create on a tab on their profile page.
The way I have done this feels a little indirect. I have:
- Created a view which lists all of a user's questions and made a block to display it.
- Configured the block so that it only displays on the right path ("user/*/questions").
- Created an entry in hook_menu for this path. Used a page callback which calls a function which creates an empty page (see below).
Is there a more direct way to do this by, e.g., attaching the view directly to the profile page?
The code in hook_menu()
is:
$items['user/%/questions'] = array(
'title' => 'Your Questions',
'description' => 'User Questions',
'page callback' => 'answers_blank_page',
'access arguments' => array('create question content'),
'type' => MENU_LOCAL_TASK,
'weight' => 9,
);
The page callback is simply:
function answers_blank_page () {
return '';
}