I asked a similar question a few months ago, but the true is that there is very few information about the correct way of doing this.
The simplest is using arg() functions, but as you can read in the docs, is the most wrong way of doing it. Trying to follow the correct steps, that is what I have so far:
A menu with the paths which we need:
/*
* Category search section
*/
$items['products/search/%/%'] = array(
'title' => 'Products search filtering',
'description' => 'Show review categories.',
'page callback' => 'ThemeSearchProducts',
'page arguments' => array(2,3),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_NORMAL_ITEM,
'file' => 'includes/mymodule_reviews.inc',
);
This arguments are sended via ... arguments (sorry for the joke). to the themesearchproducts function
/**
* THEME List of reviewable products
*
*/
function ThemeSearchProducts($arg1, $arg2){
// $output = theme('search_products', $arg1);
$output = theme('search_products', 'test');
echo 'args in theme: ' . $arg1 . $arg2 . ' || ';
return $output . theme('pager', 10);
}