Help, theme not working.

Permalink
I am trying to build a very bare bones theme to build on at a later point, and believe I have included at the code necessary. The theme appears properly in the themes section with a thumbnail and all, but when i apply it the website only shows the coding of the theme. Can someone please point out what is missing(code below).
Thanks

<head>

<?php
Loader::element(‘header_required’);
?>

<link href=”<?=$this->getStyleSheet(‘main.css’)?>” rel=”stylesheet” type=”text/css” />

</head>

<body>

<div id="header">

<?php
$a = Global Area(‘HeaderNav’);
$a->display($c);
?>

</div>

<div id="content">

<?php
$a = new Area(‘Main’);
$a->display($c);
?>

</div>

<div id="footbox">

<?php
$a = Global Area(‘FootBox’);
$a->display($c);
?>

<a href=”<?=$this->url(‘login’)?>”><?=t(‘Login’)?></a>

</div>

<?php Loader::element(‘footer_required’); ?>

</body>

 
apc123 replied on at Permalink Reply
apc123
Can you send a URL so I can take a look?
bpbuild replied on at Permalink Reply
Sure, here is the site with the non-functioning theme applied.http://bmpbuild.com/concrete/
landollweb replied on at Permalink Reply
landollweb
Here's what I'm seeing as the source for the generated page:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>
<body>
<pre>
<!DOCTYPE html>  
<html></pre>
<p><head></p>
<p><?php<br>
  Loader::element(‘header_required’);<br>
?></p>
<p><link href=”<?=$this->getStyleSheet(‘main.css’)?>” rel=”stylesheet” type=”text/css” /></p>


I'm curious to know what program you're using to type your template code?
bpbuild replied on at Permalink Reply
I am using Dreamweaver. I am very new to it, but I made a php document and this has been what I am getting
bpbuild replied on at Permalink Reply
I threw the code into notepad and saved it as php to see if that changed anything and using just the raw code got the following warning:


Warning: include(/home/bmpbui5/public_html/concrete/concrete/elements/�header_required�.php) [function.include]: failed to open stream: No such file or directory in /home/bmpbui5/public_html/concrete/concrete/core/libraries/loader.php on line 88

Warning: include() [function.include]: Failed opening '/home/bmpbui5/public_html/concrete/concrete/elements/�header_required�.php' for inclusion (include_path='/home/bmpbui5/public_html/concrete/libraries/3rdparty:/home/bmpbui5/public_html/concrete/concrete/libraries/3rdparty:.:/usr/lib/php:/usr/local/lib/php') in /home/bmpbui5/public_html/concrete/concrete/core/libraries/loader.php on line 88

Fatal error: Call to undefined function GlobalArea() in /home/bmpbui5/public_html/concrete/themes/BPTheme/default.php on line 19
landollweb replied on at Permalink Reply
landollweb
Okay, let's see what you now have in your template file.
bpbuild replied on at Permalink Reply
Here is the code that returned an error.

<!DOCTYPE html>
<html>

<head>

<?php
Loader::element(‘header_required’);
?>

<link href=”<?=$this->getStyleSheet(‘main.css’)?>” rel=”stylesheet” type=”text/css” />

</head>

<body>

<div id="header">

<?php
$a = GlobalArea(‘HeaderNav’);
$a->display($c);
?>

</div>

<div id="content">

<?php
$a = new Area(‘Main’);
$a->display($c);
?>

</div>

<div id="footbox">

<?php
$a = GlobalArea(‘FootBox’);
$a->display($c);
?>

<a href=”<?=$this->url(‘login’)?>”><?=t(‘Login’)?></a>

</div>

<?php Loader::element(‘footer_required’); ?>

</body>

</html>
apc123 replied on at Permalink Reply
apc123
Can you post the file as an attachment? Either there is something missing from the cut and paste or you need to ping your webhost about this.
bpbuild replied on at Permalink Reply 1 Attachment
Here is the notepad cut/paste file, which I saved as a .txt file so it could be posted here:
apc123 replied on at Permalink Reply
apc123
There are a bunch of control characters appearing in the attachment. Instead of quotes I see things like ë and í

Whatever program you are using to write your code, abandon it and stick to a basic text editor.
landollweb replied on at Permalink Reply
landollweb
You're probably right, apc123, but I'm curious to know what you're using to view the file? When I opened the attachment in Notepad, it looked normal to me.
apc123 replied on at Permalink Reply
apc123
I'm using textwrangler on the mac.

Are the quote appearing as smart quotes? The bad characters hide like that.
landollweb replied on at Permalink Reply
landollweb
Yes, they are. Good call.
landollweb replied on at Permalink Reply
landollweb
Yeah, there's something going on there that we can't see here.
landollweb replied on at Permalink Reply
landollweb
Hmmm... this looks good to me, unless I'm overlooking something. I presume the themes that come packaged with C5 are working okay for you?

By the way, I think I know how all those p tags got into your code originally. I knew I had seen that sort of thing before - I use Dreamweaver also. I'm guessing you originally typed your code in the "Design" window of Dreamweaver, rather than the "Code" window. (You select between them at the top of the edit window, there are tabs in the upper-right of the tool bar.)
bpbuild replied on at Permalink Reply
Yes, if I apply any of the themes from core or through the marketplace they run perfectly. Luckily I'm using Web Hosting Hub which has some concrete5 contributors working there.
landollweb replied on at Permalink Reply
landollweb
Okay, can you switch the site back to your barebones theme so we can look more closely at the error messages?
apc123 replied on at Permalink Reply 1 Attachment
apc123
Attached is a screenshot of the code with the encoded characters instead of quotes and parentheses. Find a basic text editor instead of Dreamweaver.
bpbuild replied on at Permalink Reply
Alright I will try out textpad, and just retyping out everything. if not I will ping my webhost for some help. Thank you both for your help.
bpbuild replied on at Permalink Reply
So after retyping everything 2 of the warnings are gone and the last message left is:

Fatal error: Call to undefined function GlobalArea() in /home/bmpbui5/public_html/concrete/themes/BPTheme/default.php on line 9
landollweb replied on at Permalink Reply
landollweb
Oh - change that line to read:

<?php $a = new GlobalArea('Site Name'); $a->display(); ?>


(Add "new".)
bpbuild replied on at Permalink Reply
Thank you both so much. That was the last change needed and now the theme is working.
landollweb replied on at Permalink Reply
landollweb
Just a couple of things I noticed on first glance... Try adding a doctype declaration at the top of your theme template.
<!DOCTYPE html>
<html>

Then at the bottom close the html tag.

Also, the following:
$a = Global Area('HeaderNav');

should read
$a = GlobalArea('HeaderNav');
landollweb replied on at Permalink Reply
landollweb
Oh - looks like the doctype declaration and html tags were already there. You can take out what you added, they're supposed to go at the top of the page, not in the body.
bpbuild replied on at Permalink Reply
I put them after you pointed them out. They sit outside the body tags from what I see, but haven't changed much. On a side note when I open the cPanel file manager and do code edit, it is reading all the concrete specific code as if they are <p> rather than php coding... I.E:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>

<body>
<pre>
<!DOCTYPE html>
<html></pre>
<p><head></p>
<p><?php<br>
Loader::element(‘header_required’);<br>
?></p>
landollweb replied on at Permalink Reply
landollweb
Yeah - see the page source I posted above. I think your code editing program is messing with you. You need to strip out all that spurious code. (i.e. p tags etc.) Make what is in your template file look more like what you originally posted.
apc123 replied on at Permalink Reply
apc123
Have you tried posting a basic HTML page? Create a simple one line HTML page outside of Concrete5 and post it. Check it and see that the webserver is configured correctly. This will check if your webserver is handling the mime types correctly.
bpbuild replied on at Permalink Reply
Simple test of html worked. Gave me no errors and returned the <p>Testing 1...2...3...</p> properly