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?
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Jerome Bakker@jeabakker

Jerome Bakker - 0 likes
- AlexGeorge2323@AlexGeorge2323

AlexGeorge2323 - 0 likes
You must log in to post replies.Hi Alex,
?view is kinda a special variable within Elgg, it changes the viewtype you're using. Normaly every thing in viewed from /views/default, but if you set view=print the system looks in /views/print.
Since there a probably no views in this directory no content will be displayed.
Easiest solution, don't call the var 'view' but maybe ?print=1
Hope this helps
Great - thanks for your help Jerome. I will give that a shot.