unexpected T_STRING when main content added

Permalink
I am creating a custom theme.

Everything works up until the step where I add the

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

When this is added and I load the C5 page I get
"Parse error: syntax error, unexpected T_STRING in /services4/webpages/util/y/e/yeuell.site.aplus.net/public/cms53/themes/yeuelltheme/default.php on line 264"

line 264 being the above line of code.
Any thoughts?


Also, in what folder do the "areas" live?
so in other words if you create an area "Main Content" what folder does Main Content reside in?

thanks

 
glockops replied on at Permalink Reply
glockops
Check the other PHP code in your template. I imagine the php code before this code is the culprit.

Main Content doesn't exist as a "folder" but as a database field. concrete will run a query finding blocks in the area name, on the page you're viewing/editing.

It's important to note that if you every change themes, you'll need to make sure that the area names match - otherwise any content added to "custom" area name won't display.
wkm replied on at Permalink Reply
Thanks very much for the reply.

The only other php in the default page is the
"loader element" in the head.

When you designate an "area", don't you need to upload a file with that name somewhere? So for instance if you designate an area "Main Content" - isn't there an actual file named "Main Content" somewhere...

I thought this process was similar to using a standard PHP include function in html...
glockops replied on at Permalink Reply
glockops
Make sure the loader element has a semi-colon at the end of it.
<?php Loader::element('header_required'); ?>


The Areas do not behave as php includes. The areas you specify will be contained in the database "Areas" table. The blocks that are inserted into your areas will be matched the the Areas table by the arID handle.

It's important to note that you can now split areas using the layout feature. So chances are you'll only need a couple of areas in your theme.

FYI: You can get a similar function to a standard PHP include by using the following code.
<?php $this->inc('elements/header.inc.php'); ?>

Where elements/ is a folder that is within the theme's directory.

You will probably want to review the documents on construction a theme - there's lot's of other cool functions that will help make your theme work better.
wkm replied on at Permalink Reply
I had followed the online doc for implementing your own html design as a theme.
Turns out, when I took the "new area" code above, and set it on 1 line only, it worked!

Thanks for the help glockops - contact me via email please.