Best practice forum (Archived)

Making main content page scale entire page?

 
John Unnever
Making main content page scale entire page?
door John Unnever - Monday, 11 January 2016, 20:09 PM
Groep Partners

Hi guys,

I've custom developed some new Forms to use in Totara, some of which are fairly large.  I could benefit from removing the navigation block from the form page to take use of the entire width of the browser.  I've figured out how to "HIDE" the navigation block with CSS, but the space it occupies still consumes screen space as blank white space.  Does anyone know how i can accomplish this and if it's fairly simple ?

Sam Hemelryk
Re: Making main content page scale entire page?
door Sam Hemelryk - Monday, 11 January 2016, 20:40 PM
Groep Totara

Hi John,

There is no easy way to say in code "I don't want the navigation block".
However if you are happy to get rid of all blocks then the best way to do this is to set the page layout to use "noblocks".
Add this line of code to the php files that uses your form:

$PAGE->set_pagelayout('noblocks');

You'll need to add it after you call require_login and before you first use OUTPUT and before you initialise the form.

The page layout controls which block regions are on the page. The noblocks layout does as its name suggests and has no block regions, thus no blocks will be present.
The noblocks layout is added by Totara and may not be present in all themes.
If the above does not work let me know what Totara version you are using and I can instruct you further.

Hope that helps.

Cheers
Sam

John Unnever
Re: Making main content page scale entire page?
door John Unnever - Thursday, 14 January 2016, 21:26 PM
Groep Partners

Thanks Sam, the noblocks did the trick!!  

? ?
Re: Making main content page scale entire page?
door ? ? - Tuesday, 12 January 2016, 01:13 AM
 

Hi, there is also an a tag added in before each block that could be the cause of the space you're seeing.

<a href="#sb-19" class="skip-block">Skip blockname</a>

Hope this helps

David