Global areas example is missing $c

Permalink
The global areas example is missing $c

View Replies: View Best Answer
mhawke replied on at Permalink Best Answer Reply
mhawke
That's because it doesn't use $c

Here's a Global Area:

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


and here's a regular area:

<?php
$a = new Area('Main');
$a->display($c);
?>
riwalk replied on at Permalink Reply
Then in that case the article needs to be updated. Below the global example, it says:

"The first line creates a new area object named Sidebar, and the second line renders the contents of that area object. But what does that $c reference? $c refers to the collection object for the current page. The collection object consists of the current page’s blocks."

Clearly not applicable.
jasteele12 replied on at Permalink Reply
jasteele12
Agreed, the 2nd and 3rd sentences should be deleted.

There are a few other problems:

* The collection object consists of *more* than just the current page’s blocks

* This sentence should be *above* Global Areas
"In the code snippet above, we’re rendering the area object named Sidebar from whatever the current page / collection is"

* Stacks are missing

* Tools (index.php is not required with Pretty URLs enabled) and definitely do not work called with the trailing .php

Placed in the root * /tools/ directory * of your site, a tools script is called like these examples:

http://www.concrete5-site.com/index.php/tools/my_custom_script.php


or with Pretty URLs enabled:

http://www.concrete5-site.com/tools/my_custom_script


With pretty URLs enabled, the above URL *cannot* have the .php extension.

Maybe this bump will catch someone's attention that *can* change the content. Instead of just comments, it sure would be nice if this was a concrete5 core wiki content type :)
kidconcept replied on at Permalink Reply
kidconcept
agreed. this confused me as well. following the Global Area example the text says "But what does that $c reference?" In this example, there is no $c. Just removing these two sentences would help, or even better a simple explanation of why the global area is _lacking_ the $c variable.