Missing Content Area
Permalink
Hi all,
I made a template here is the view.php:
<?php
defined('C5_EXECUTE') or die(_("Access Denied."));
$this->inc('elements/header.php'); ?>
<div id="wrapper">
<div id="header">
<div id="header_imgs">
<div id="menu">
<?php
$a = new Area('Navigation');
$a->display($c);
?>
</div>
<div id="header_content">
<?php
$a = new Area('Header Content');
$a->display($c);
?>
</div>
</div>
</div>
<div id="content">
<div id="main_content1">
<?php
$a = new Area('Main Content');
$a->display($c);
?>
</div>
</div>
<div id="footer">
<div id="footer_nav">
<span class="powered-by"><?php echo t('Built with concrete5')?> <a href="http://www.concrete5.org">CMS</a>.</span>
© <?php echo date('Y')?> <a href="<?php echo DIR_REL?>/"><?php echo SITE?></a>.
<?php echo t('All rights reserved.')?>
<?php
$u = new User();
if ($u->isRegistered()) { ?>
<?php
if (Config::get("ENABLE_USER_PROFILES")) {
$userName = '<a href="' . $this->url('/profile') . '">' . $u->getUserName() . '</a>';
} else {
$userName = $u->getUserName();
}
?>
<span class="powered-by"><?php echo t('Currently logged in as <b>%s</b>.', $userName)?> <a href="<?php echo $this->url('/login', 'logout')?>"><?php echo t('Sign Out')?></a></span>
<?php } else { ?>
<span class="sign-in"><a href="<?php echo $this->url('/login')?>"><?php echo t('Sign In to Edit this Site')?></a></span>
<?php } ?>
</div>
</div>
</div>
<?php $this->inc('elements/footer.php'); ?>
Here is the source code of the actual page:
<div id="content">
<div id="blockStyle22" class=" ccm-block-styles" >
<div style="width:100%">
<div class="" style="min-height:1px;width:255px;float:left;vertical-align:top;;margin-left: 0px;margin-right: 24.5px">
<div id="areaStyle13" class=" ccm-area-styles ccm-area-styles-a54" >
<div id="blockStyle13" class=" ccm-block-styles" >
<h1><span style="font-family: trebuchet ms,geneva;">This is a test</span></h1>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;"><br /></span></p></div></div> </div>
<div class="" style="min-height:1px;width:255px;float:left;vertical-align:top;;margin-left: 24.5px;margin-right: 24.5px">
<div id="areaStyle13" class=" ccm-area-styles ccm-area-styles-a55" >
<div id="blockStyle13" class=" ccm-block-styles" >
<h1><span style="font-family: trebuchet ms,geneva;">This is a test</span></h1>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p></div></div> </div>
<div class="" style="min-height:1px;width:255px;float:left;vertical-align:top;;margin-left: 24.5px;margin-right: 0px">
<div id="areaStyle13" class=" ccm-area-styles ccm-area-styles-a56" >
<div id="blockStyle13" class=" ccm-block-styles" >
<h1><span style="font-family: trebuchet ms,geneva;">This is a test</span></h1>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p></div></div> </div>
</div>
The main content area is occupied and displays but when the php outputs the html it does not output the id="main_content" div. Therefore the styling I have for it does not take effect. Can someone tell me why the id="main_content" div won't output and how to fix it? Thanks.
I made a template here is the view.php:
<?php
defined('C5_EXECUTE') or die(_("Access Denied."));
$this->inc('elements/header.php'); ?>
<div id="wrapper">
<div id="header">
<div id="header_imgs">
<div id="menu">
<?php
$a = new Area('Navigation');
$a->display($c);
?>
</div>
<div id="header_content">
<?php
$a = new Area('Header Content');
$a->display($c);
?>
</div>
</div>
</div>
<div id="content">
<div id="main_content1">
<?php
$a = new Area('Main Content');
$a->display($c);
?>
</div>
</div>
<div id="footer">
<div id="footer_nav">
<span class="powered-by"><?php echo t('Built with concrete5')?> <a href="http://www.concrete5.org">CMS</a>.</span>
© <?php echo date('Y')?> <a href="<?php echo DIR_REL?>/"><?php echo SITE?></a>.
<?php echo t('All rights reserved.')?>
<?php
$u = new User();
if ($u->isRegistered()) { ?>
<?php
if (Config::get("ENABLE_USER_PROFILES")) {
$userName = '<a href="' . $this->url('/profile') . '">' . $u->getUserName() . '</a>';
} else {
$userName = $u->getUserName();
}
?>
<span class="powered-by"><?php echo t('Currently logged in as <b>%s</b>.', $userName)?> <a href="<?php echo $this->url('/login', 'logout')?>"><?php echo t('Sign Out')?></a></span>
<?php } else { ?>
<span class="sign-in"><a href="<?php echo $this->url('/login')?>"><?php echo t('Sign In to Edit this Site')?></a></span>
<?php } ?>
</div>
</div>
</div>
<?php $this->inc('elements/footer.php'); ?>
Here is the source code of the actual page:
<div id="content">
<div id="blockStyle22" class=" ccm-block-styles" >
<div style="width:100%">
<div class="" style="min-height:1px;width:255px;float:left;vertical-align:top;;margin-left: 0px;margin-right: 24.5px">
<div id="areaStyle13" class=" ccm-area-styles ccm-area-styles-a54" >
<div id="blockStyle13" class=" ccm-block-styles" >
<h1><span style="font-family: trebuchet ms,geneva;">This is a test</span></h1>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;"><br /></span></p></div></div> </div>
<div class="" style="min-height:1px;width:255px;float:left;vertical-align:top;;margin-left: 24.5px;margin-right: 24.5px">
<div id="areaStyle13" class=" ccm-area-styles ccm-area-styles-a55" >
<div id="blockStyle13" class=" ccm-block-styles" >
<h1><span style="font-family: trebuchet ms,geneva;">This is a test</span></h1>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p></div></div> </div>
<div class="" style="min-height:1px;width:255px;float:left;vertical-align:top;;margin-left: 24.5px;margin-right: 0px">
<div id="areaStyle13" class=" ccm-area-styles ccm-area-styles-a56" >
<div id="blockStyle13" class=" ccm-block-styles" >
<h1><span style="font-family: trebuchet ms,geneva;">This is a test</span></h1>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p>
<p><span style="font-size: small;">test</span></p></div></div> </div>
</div>
The main content area is occupied and displays but when the php outputs the html it does not output the id="main_content" div. Therefore the styling I have for it does not take effect. Can someone tell me why the id="main_content" div won't output and how to fix it? Thanks.
Tried your changes with no change in result. The <div id="main_content1"> does not get generated into the actual source code. That is the main problem. Any other ideas? Thanks for the reply.
I agree, "Main content1" is asking for problems, but it should still display unless you are actually getting output from another template and NOT the view.php. I have run into that before where I thought I had selected a certain view and I actually was looking at code from another page type. Just something to think about.
How is that possible? It display everything else in my template right. What did you do to find that problem, and more importantly what did you do to correct it?
That did it. When I updated the view.php I forgot to update the default.php as well. Thanks. On to the next hangup.
btw, next time try using the [/code] tags
[code]
Could you explain?
I think Mnkras means you should wrap code snippets in "[ code ] snippet goes here [ /code ]"
Example:
Example:
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); $this->inc('elements/header.php'); ?> <div class="clear span-23 last" id="content"> <div class="clear span-6" id="sidebar"><?php $a = new Area('Sidebar'); $a->display($c);?> </div> <!-- end sidebar --> <div class="span-17 last" id="main"><?php $a = new Area('Main'); $a->display($c);?> </div> <!-- end main --> </div> <!-- end content --> <?php $this->inc('elements/footer.php'); ?>
<?php
$a = new Area('Main Content');
$a->display($c);
?>"
the 1 at the end could cause issues. Also it's best to have your main content be named "Main" not "Main Content".