Hide header and footer in moodle page makes page elements also hidden

Hide header and footer in moodle page makes page elements also hidden

by Santhosh Samban -
Number of replies: 1

I have moodle page like the following with a form inside it:


<?php

require_once('../../config.php');

global $DB;

global $COURSE;

$courseid = $COURSE->id;

if (!$course = $DB->get_record('course', array('id' => $courseid))) {

    print_error('invalidcourse', 'block_eparticipation', $courseid);

}

 

require_login($course);

$PAGE->set_url('/blocks/eparticipation/view.php', array('id' => $courseid));

$PAGE->set_pagelayout('standard');

echo $OUTPUT->header();

require_once(dirname(__FILE__).'/epoll_form.php');

  $pollform = new mform("poll_action.php?val={$valid}");

  $pollform->display();

echo $OUTPUT->footer(); 

?>


I need to hide the header and footer so I did as follows:


echo "<div style='display:none;'>";

echo $OUTPUT->header();

echo "</div>";

.............................

echo "<div style='display:none;'>";

echo $OUTPUT->footer();

echo "</div>";


But When I did this my form also get hidden.  I am getting a blank page. 


I want to hide the header and footer only with my form not hidden.Please guide me.

Average of ratings: -
In reply to Santhosh Samban

Re: Hide header and footer in moodle page makes page elements also hidden

by Praveen Chamarthi -

Hi ,


you can remove echo $OUTPUT->header(); and echo $OUTPUT->footer(); from you page.

then you will not get header and footer in your page.