qwertyhosting Posted July 31, 2019 Share Posted July 31, 2019 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"); 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 1, 2019 Share Posted August 1, 2019 0 Quote Link to comment Share on other sites More sharing options...
qwertyhosting Posted August 1, 2019 Author Share Posted August 1, 2019 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. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 2, 2019 Share Posted August 2, 2019 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... 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... 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... 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. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.