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>
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>
Can you send a URL so I can take a look?
Sure, here is the site with the non-functioning theme applied.http://bmpbuild.com/concrete/
Here's what I'm seeing as the source for the generated page:
I'm curious to know what program you're using to type your template code?
<!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>
Viewing 15 lines of 41 lines. View entire code block.
I'm curious to know what program you're using to type your template code?
I am using Dreamweaver. I am very new to it, but I made a php document and this has been what I am getting
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
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
Okay, let's see what you now have in your template file.
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>
<!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>
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.
Here is the notepad cut/paste file, which I saved as a .txt file so it could be posted here:
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.
Whatever program you are using to write your code, abandon it and stick to a basic text editor.
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.
I'm using textwrangler on the mac.
Are the quote appearing as smart quotes? The bad characters hide like that.
Are the quote appearing as smart quotes? The bad characters hide like that.
Yes, they are. Good call.
Yeah, there's something going on there that we can't see here.
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.)
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.)
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.
Okay, can you switch the site back to your barebones theme so we can look more closely at the error messages?
Attached is a screenshot of the code with the encoded characters instead of quotes and parentheses. Find a basic text editor instead of Dreamweaver.
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.
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
Fatal error: Call to undefined function GlobalArea() in /home/bmpbui5/public_html/concrete/themes/BPTheme/default.php on line 9
Oh - change that line to read:
(Add "new".)
<?php $a = new GlobalArea('Site Name'); $a->display(); ?>
(Add "new".)
Thank you both so much. That was the last change needed and now the theme is working.
Just a couple of things I noticed on first glance... Try adding a doctype declaration at the top of your theme template.
Then at the bottom close the html tag.
Also, the following:
should read
<!DOCTYPE html> <html>
Then at the bottom close the html tag.
Also, the following:
$a = Global Area('HeaderNav');
should read
$a = GlobalArea('HeaderNav');
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.
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>
<!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>
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.
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.
Simple test of html worked. Gave me no errors and returned the <p>Testing 1...2...3...</p> properly