page_handler issue

Hi all,

I am currently reading the Elgg1.8 textbook and I have an elgg1.8.1 distribution running locally via xampp on windows 7. When I follow the page handler tutorial and add the page to the site menu, it doesn't load my page. Instead it prints out the default message out of my switch statement. I can't seem to find the error, since my paths are correct. Here is the code:

function au_page_handler($page, $identifier) {
    // Path to plugin folder
    $plugin_path = elgg_get_plugins_path();

    // Pages folder
    $base_path = $plugin_path . '<plugin_name>/pages/<plugin_name>';

    // Page is selected upon first url segment after /<plugin_name>/
    switch($page) {        
        case '<page_name>':
            require "$base_path/<page_name>";
            break;
        default:
            echo "Not Found! $identifier $page[0]";
            break;
    }

    // Confirm to Elgg that page has been sent to browser
    return true;    
}

MY PAGE CODE:

// Title varaible
$title = "Title of page";

// Content varaible
$content = "Content here";

// Set metadata for the page
$vars = array(
    'content' => $content,
);

// Creates body of the page.
$body = elgg_view_layout('one_sidebar', $vars);


// Next line passes the title and the body to the elgg function.
echo elgg_view_page($title, $body);

Any advice is greatly appreciated.

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking