getPageWrapperClass

Permalink
I am using Concrete 5.7.8.5. I am trying to Convert this HTML theme from Codyhouse -https://codyhouse.co/gem/project-cards-template/....

I used this tutorial -http://documentation.concrete5.org/developers/designing-for-concret...

Everything worked until I added the <div class="<?= $c->getPageWrapperClass() ?>". I tried it in several different places after <body> as well as the </div> at the end of the page before </body> . It totally screws up my page. Before I do this everything works but of course the side panels do not shift the content over.

I am somewhat of a novice so very basic language is needed.

Help!

 
siton replied on at Permalink Reply
siton
YOUR CODE MISSING THE "ECHO" STATEMENT!!!!

THIS code in your theme:
I am the wrapper class: "<?php echo $c->getPageWrapperClass(); ?>"

OUTPUT something like this (depend on page template & type):
I am the wrapper class: "ccm-page page-type-portfolio-single page-template-portfolio-single"

Now you need to add this "wrapper" line to some html tag (like in the tutorial)
---------------------------------------------------------------------------------
IN GENERAL (i dont think this should broke all of your site):
Inspect the output html! - also check your site when you are logout + JS conflicts!

Maybe you missing "closing" angle brackets or small issue like this. 3 examples of "bad" code.
//1. Bad code - missing "closing" angle brackets  
<div class="main-content <?php echo $c->getPageWrapperClass()?>" //Bad code example

OR
// 2. Bad code - missing "Quotation mark"   
//Bad code 
<div class="main-content <?php echo $c->getPageWrapperClass()?> >

OR
// 3. Bad code - missing space " " between other class to the wrapper   
//Bad code 
<div class="main-content<?php echo $c->getPageWrapperClass()?>" >
Gondwana replied on at Permalink Reply
Gondwana
The issue might be more subtle. <?= is a short form for echo, but it isn't always available. It depends on php version and configuration; see
http://php.net/manual/en/function.echo.php...

The safest bet is to assume that <?= isn't available and always use <? echo, as siton suggested.
fancyslice replied on at Permalink Reply
Thank you for your reply

I tried several formations
<div class="main content <? echo $c->getPageWrapperClass() ?>">
<div class="<? echo $c->getPageWrapperClass() ?>">
<div class="main-content <?php echo $c->getPageWrapperClass()?>">
<div class="<?php echo $c->getPageWrapperClass()?>">
<div class="<?= $c->getPageWrapperClass() ?>">
<div class="main-content <?= $c->getPageWrapperClass() ?>">


Non of these worked. I get a black background with two buttons at the top but all other content is gone. The content that is there does slide over as i was trying to get it to do. But, I cannot seem to get the page to display as it should. Any other suggestions?

I went back and tried all of them a second time with a space between " and > at the end of the code.

Still no luck :(
Gondwana replied on at Permalink Reply
Gondwana
I think the correct form is
<div class="<?php echo $c->getPageWrapperClass()?>">

This seems to go immediately after your <body> line.

It's beneficial to dredge through other c5 code to see how others have done it. In this case, an example is ...\concrete\themes\elemental\elements\header_top.php

Don't forget that, for every <div>, you'll need a corresponding </div> in the appropriate place.
fancyslice replied on at Permalink Reply
Ok so I copied the code you wrote out Gondwana and pasted it diretly into my file under <body>.

Then at the very bottom of my page I put
</div>
<?php Loader::element('footer_required') ?>
</body>
>/html>

Still no luck. Very confused???
Gondwana replied on at Permalink Reply
Gondwana
Presumably </html>
fancyslice replied on at Permalink Reply
Sorry to be so confusing but the >/html> was a typo in my reply not my file. It is </html> in the file I am having problems with.
MrKDilkington replied on at Permalink Reply
MrKDilkington
Hi fancyslice,

I recommend using the default Elemental theme as an example:

- The page wrapper div and matching class should be the first element after the opening body tag:
https://github.com/concrete5/concrete5/blob/develop/concrete/themes/...
- The page wrapper should contain the full content of your pages:
https://github.com/concrete5/concrete5/blob/develop/concrete/themes/...
- After the closing page wrapper div, you add <?php Loader::element('footer_required'); ?> . This should be the last element before the closing body tag:
https://github.com/concrete5/concrete5/blob/develop/concrete/themes/...

Here is the Elemental theme header_top.php, header.php, default.php, footer.php, and footer_bottom.php combined:
<!-- header_top.php -->
<?php defined('C5_EXECUTE') or die("Access Denied."); ?>
<!DOCTYPE html>
<html lang="<?php echo Localization::activeLanguage()?>">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link rel="stylesheet" type="text/css" href="<?php echo $view->getThemePath()?>/css/bootstrap-modified.css">
    <?php echo $html->css($view->getStylesheet('main.less'))?>
    <?php Loader::element('header_required', array('pageTitle' => isset($pageTitle) ? $pageTitle : '', 'pageDescription' => isset($pageDescription) ? $pageDescription : '', 'pageMetaKeywords' => isset($pageMetaKeywords) ? $pageMetaKeywords : ''));?>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script>
        if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
            var msViewportStyle = document.createElement('style')
            msViewportStyle.appendChild(
                document.createTextNode(
madeforspace replied on at Permalink Reply
madeforspace
Hi All

Was this ever resolved?
I am getting an identical situation at the moment.http://www.concrete5.org/community/forums/customizing_c5/getpagewra...

I went through the last steps MrKDilkington suggested and thought I may have cracked when I noticed I had placed my closing div before my <?php Loader::element('footer_required'); ?> but even when I swapped them I still get a visual error.

Driving me a bit nuts now :(