include of header.php and footer.php doesn't seem to work.

Permalink
As beginner I try to work through the C5 tutorials. In the 'Basic Theme Development Training Three' the header and footer get separated from the content part.
Although I followed exactly the instructions step by step, I get errors publishing the site (-> attached screenshot).

I suppose it has something to do with the mixture of slashes and backslashes in the paths.

Can anyone help me with this mix-up?

1 Attachment

Jormungand
 
planist1 replied on at Permalink Reply
planist1
can you post the header.php, footer.php, view.php and the default.php file content?
Jormungand replied on at Permalink Reply
Jormungand
Sorry pianist, I could not answer because my c5 account has been deactivated temporarily for no reason.

My source code should be the same as in the tutorial video.

Here's the header.php:
<!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" dir="ltr">
<head profile="http://gmpg.org/xfn/11">
<title>Darkness | Full Width</title>
<meta http-equiv="imagetoolbar" content="no" />
<link rel="stylesheet" href="<?php echo $this->getThemePath(); ?>/styles/layout.css" />
<?php Loader::element('header_required'); ?>
</head>
<body id="top">
<div class="wrapper">
  <div id="header">
    <div id="logo">
      <?php
        $a = new GlobalArea('Site Logo');
      $a->display();


default.php:
<?php $this->inc('elements/header.php'); ?>
<div class="wrapper">
  <div id="container">
    <?php
        $a = new Area('Main');
      $a->display($c);
     ?>
  </div>
</div>
<?php $this->inc('elements/footer.php'); ?>


footer.php:
<div class="wrapper">
  <div id="footer">
    <div id="newsletter">
    <?php
        $a = new GlobalArea('Newsletter Signup');
      $a->display();
     ?>
    </div>
    <div class="footbox">
      <?php
        $a = new GlobalArea('Footbox 1');
      $a->display();
     ?>
    </div>
    <div class="footbox">
planist1 replied on at Permalink Reply
planist1
Try this

header.php
<?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">
<head profile="http://gmpg.org/xfn/11">
<title>Darkness | Full Width</title>
<meta http-equiv="imagetoolbar" content="no" />
<link rel="stylesheet" href="<?php echo $this->getThemePath(); ?>/styles/layout.css" />
<?php Loader::element('header_required'); ?>
</head>
<body id="top">
<div class="wrapper">
  <div id="header">
    <div id="logo">
      <?php
        $a = new GlobalArea('Site Logo');
      $a->display();


default.php
<?php  
defined('C5_EXECUTE') or die("Access Denied.");
$this->inc('elements/header.php'); ?>
<div class="wrapper">
  <div id="container">
    <?php
        $a = new Area('Main');
      $a->display($c);
     ?>
  </div>
</div>
<?php $this->inc('elements/footer.php'); ?>


footer.php
<?php   defined('C5_EXECUTE') or die("Access Denied."); ?>
<div class="wrapper">
  <div id="footer">
    <div id="newsletter">
    <?php
        $a = new GlobalArea('Newsletter Signup');
      $a->display();
     ?>
    </div>
    <div class="footbox">
      <?php
        $a = new GlobalArea('Footbox 1');
      $a->display();
     ?>
    </div>
Jormungand replied on at Permalink Reply
Jormungand
Thank you for your help planist, but I still get the same error message as before.

I may be wrong but the error output with its mixture of local paths (E:\xampp\htdocs\... with backslashes) with web paths ( .../themes/darkness/elements... with slashes) looks suspicious to me.
And I have no idea how to change it.

Do you have another suggestion?
planist1 replied on at Permalink Reply
planist1
Where did you put your theme? Make sure it is in the root/themes folder and not in root/concrete/themes folder.
Jormungand replied on at Permalink Reply
Jormungand
The theme is in the root/theme folder.

When the header and footer are all in the default.php the site works fine. It crashes when I put the header and footer area in separate files.
planist1 replied on at Permalink Reply
planist1
When you separate the header.php and footer.php are you putting them in the elements folder of your theme?
Jormungand replied on at Permalink Reply
Jormungand
I put the header.php and the footer.php in the elements folder.

On your post I also tried out to put header.php and footer.php in the same folder as default.php but the error message stays the same.
Jormungand replied on at Permalink Reply
Jormungand
I made a new installation of C5 in the web.
Now only the content area (default.php) is shown. So the styles called up in the header.php are also not shown.

If somone likes to take a look:
http://www.grohtesk.de/test

So it seems it's not a problem of the local webserver...
planist1 replied on at Permalink Reply 1 Attachment
planist1
I took the code I gave you and made a basic theme. It is attached. I also included a view.php file to be used for pages not associated with the page types installed. Testing this in C5-5.6.2.1 and it works.
Jormungand replied on at Permalink Reply 1 Attachment
Jormungand
After unzipping, installing and activating your theme I got no error, but still header.php and footer.php are missing. (attached error2.jpg)

I would say that my installation of xampp or c5 is corrupted, but I also tried a fresh installation of c5 on my webspace and it shows the same output like on localhost. This can't be the issue.

(I feel like a candidate in a funny hidden camera show. Laugh at my stupid face.)
planist1 replied on at Permalink Best Answer Reply
planist1
It looks as though yourwww.www.grohtesk.de/test/index.html... shows you have word press installed in the same directory. I am guessing there might be a conflict there.
Jormungand replied on at Permalink Reply
Jormungand
I now put oncrete5 in a subdomain so the WP has no influence on C5, with the same effect as before.
A friend of mine has now installed C5 on his webspace and everything works well.

Edit:
My friend put the theme in the /concrete/themes folder instead of the /themes folder. Surprisingly that works!
Any ideas why the themes folder in the core works?
planist1 replied on at Permalink Reply
planist1
That's a little crazy. Check your root/config/site.php, the root/config/site_theme_paths.php, and your .htaccess files. There might be something in there showing why that is happening.
Jormungand replied on at Permalink Reply
Jormungand
My installation works now!
I think there were three problems at a time so I couldn't find the source of the problem.

The first problem was part of the xampp installation. Testing c5 pages on localhost still doesn't work.

The second was the concrete5 installation in a subfolder of a WP installation.

An the third was (mea maxima culpa!) refreshing the page but not clearing the cash.

Thanks a lot planist for your help and patience and sorry for my inattention.
planist1 replied on at Permalink Reply
planist1
No worries! Just glad you got it sorted.