Best practice forum (Archived)

Making main content page scale entire page?

 
John Unnever
Making main content page scale entire page?
על ידי John Unnever בתאריך 11/01/2016, 20:09
קבוצה 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?
על ידי Sam Hemelryk בתאריך 11/01/2016, 20:40
קבוצה 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?
על ידי John Unnever בתאריך 14/01/2016, 21:26
קבוצה Partners

Thanks Sam, the noblocks did the trick!!  

david lewendon
Re: Making main content page scale entire page?
על ידי david lewendon בתאריך 12/01/2016, 01:13
קבוצה Partners

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