Global areas example is missing $c

The global areas example is missing $c

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

Here's a Global Area:

$a = new GlobalArea('Site Logo');

and here's a regular area:

$a = new Area('Main');
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
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:

or with Pretty URLs enabled:

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
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.