Troubleshooting a problem viewing a page

Hi all - I am still kind of an Elgg newbie and am trying to modify a plugin that a colleague began work on, and I could use some assistance from the community troubleshooting a problem.

When a student clicks on a 'print' button, the link has the page id with "?view=print" appended to the end. Then, the main content page has an if/else statement that should check if $view=='print'.

The problem I have come across is within the condition of the 'if ?view=print'. I cannot load any page views or content within the print view section of this code:

$view = $_GET['view'];
if ($view=='print') {$print = "print";}

if ($print=="print")   { //print view }
else { //default view }


Within the if/print view, I can view the entity ($assignment) and all of its properties with var_dump ($assignment), but if I try to view it using elgg_view_entity, the page is empty and $content is null.

Within the else/default layout view, the view for an assignment entity is created like this:

$content = elgg_view_entity($assignment, array('full_view' => true));
$body = elgg_view_layout('content', array(
         'content' => $content,
         'title' => $title,
         'filter' => ''
));
echo elgg_view_page($title, $body);

But if I use that same code within the print view, it just returns the empty page with no content.

Can anyone tell me what I'm missing or how I can troubleshoot why the page will not display any layout or content?