C5 header not loading in new theme.
Permalink
Maybe this was asked before, but I can't find an answer to fix this issue.
I've just downloaded C5, installed, played with it, everything runs smooth, so I wanted to try out my hand at creating a theme. I watched the 8 minute video and followed it step by step and all worked great until this line:
<? Loader::element('header_required'); ?>
I've placed it in my default.php <head> tag, but no matter what I try when I refresh the site, the c5 toolbar doesn't show.
Here's how my HTML code looks like:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<? Loader::element('header_required'); ?>
<link href="<?=$this->getThemePath()?>/resources/css/style.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div id="container">
<div id="top">
top
</div>
<Div id="menu">
menu
</Div>
<div id="news">
news
</div>
</div>
</body>
</html>
I've just downloaded C5, installed, played with it, everything runs smooth, so I wanted to try out my hand at creating a theme. I watched the 8 minute video and followed it step by step and all worked great until this line:
<? Loader::element('header_required'); ?>
I've placed it in my default.php <head> tag, but no matter what I try when I refresh the site, the c5 toolbar doesn't show.
Here's how my HTML code looks like:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<? Loader::element('header_required'); ?>
<link href="<?=$this->getThemePath()?>/resources/css/style.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div id="container">
<div id="top">
top
</div>
<Div id="menu">
menu
</Div>
<div id="news">
news
</div>
</div>
</body>
</html>
Thank you very much for the reply.
I didn't break it into separate files. All I have is default.php with the code posted above.
I've added the 1st like like you said and the 17th line, but without a difference. I've also tried different browsers and reloading the theme after editing the default.php file.
My code now looks like this:
<?php defined('C5_EXECUTE') or die(_("Access Denied.")) ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="<?=$this->getThemePath()?>/resources/css/style.css" type="text/css" rel="stylesheet" />
<? Loader::element('header_required'); ?>
</head>
<body>
<div id="container">
<div id="top">
top
</div>
<Div id="menu">
<?php
$a = new Area('Header Nav');
$a->display($c);
?>
</Div>
<div id="news">
</div>
</div>
</body>
</html>
I didn't break it into separate files. All I have is default.php with the code posted above.
I've added the 1st like like you said and the 17th line, but without a difference. I've also tried different browsers and reloading the theme after editing the default.php file.
My code now looks like this:
<?php defined('C5_EXECUTE') or die(_("Access Denied.")) ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="<?=$this->getThemePath()?>/resources/css/style.css" type="text/css" rel="stylesheet" />
<? Loader::element('header_required'); ?>
</head>
<body>
<div id="container">
<div id="top">
top
</div>
<Div id="menu">
<?php
$a = new Area('Header Nav');
$a->display($c);
?>
</Div>
<div id="news">
</div>
</div>
</body>
</html>
You need a bit of code right before the closing body tag.
this is critical for version 5.5.
<? Loader::element('footer_required'); ?>
this is critical for version 5.5.
Thank you very much! That did the trick. It now works perfectly and I have the header bar.
Thanks that helped me as well.
Strange on an other page I didn't use the footer_required but there it was working.
Strange on an other page I didn't use the footer_required but there it was working.
header.php
footer.php
default.php
This is the contents of my header.php file. Check out line 1 and line 17. Let me know if this helps.
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
lang="en">
<head>
<title>Concrete5 Theme</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"
/>
<link rel="stylesheet" media="screen" type="text/css" href="<?php echo $this->getStyleSheet('main.css')?>" />
<link rel="stylesheet" media="screen" type="text/css" href="<?php echo $this->getStyleSheet('typography.css')?>" />
<?php Loader::element('header_required'); ?>
</head>
<body>
<div id="wrapper">
<div id="page">
<div id="header_line_top"></div>
<div id="header">
<?php
$a = new Area('Header Nav');
$a->display($c);
?>
</div>
<div id="header_line_bottom"> </div>