Jump to content

$skipMainBodyContainer


Recommended Posts

Can some explain how/where I can set $skipMainBodyContainer ?

 

I have a custom page and I want to make the contents full width. Setting $skipMainBodyContainer to true would do this but I can't get it to work.

I've tried creating a simple hook to always set this to true just to see if I could get it working but it's still not updating.

Any help would be welcomed!

 

function full_width_hook($vars) {

	return array("skipMainBodyContainer" => true);
}
add_hook("ClientAreaPage", 1, "full_width_hook");

 

Link to comment
Share on other sites

15 minutes ago, brian! said:

 

I did see that but couldn't get it to work.

Did it work for you?

 

What I was able to do was create a different variable and assign that a value in the php file for the custom page

 $ca->assign('fullWidth', true);
 $ca->assign('skipMainBodyContainer', true);

 

in the tpl file for the page it now picks up $fullWidth but still doesn't pick up $skipMainBodyContainer, despite using the same method to assign a value.

 

 

Link to comment
Share on other sites

if we go back to my very basic PHP page I gave previously...

<?php
use WHMCS\ClientArea;
define('CLIENTAREA', true);
require __DIR__ . '/init.php';
$ca = new ClientArea();
$ca->setPageTitle('Custom Page');
$ca->initPage();
$ca->setTemplate('custom');
$ca->output();

that will give the usual boxed display...

hET2P11.png

if we add a breadcrumb into that code...

<?php
use WHMCS\ClientArea;
define('CLIENTAREA', true);
require __DIR__ . '/init.php';
$ca = new ClientArea();
$ca->setPageTitle('Custom Page');
$ca->addToBreadCrumb('index.php', Lang::trans('globalsystemname'));
$ca->addToBreadCrumb('mypage.php', 'Your Custom Page Name');
$ca->initPage();
$ca->setTemplate('custom');
$ca->output();

... it adds the breadcrumb links...

Acmxi7x.png

if we then add the skipMainBodyContainer line into that php file (not as a separate hook)...

<?php
use WHMCS\ClientArea;
define('CLIENTAREA', true);
require __DIR__ . '/init.php';
$ca = new ClientArea();
$ca->setPageTitle('Custom Page');
$ca->initPage();
$ca->setTemplate('custom');
$ca->skipMainBodyContainer();
$ca->output();

... you will see that the output is now full-width...

IQCGRfa.png

even if the above code had the breadcrumbs code in, then they wouldn't appear - so there is no need to include them in the code if you're going to have a full-width page.

also, there is no formatting in the custom.tpl template other than break returns in the text... you can add formatting to the template, i'm just saying that in my above simple example, it's just contains lorem ipsum text.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated