Editbale regions and options
Permalink
Hi there, I am reading the docs about creating templates, and editable regions...
Now i have seen this example:
<? $a = new Area('Main'); $a->display($c); ?>
Now in dissecting that code... The "Main" - is that just a unique identifier? Is there a list of options for the "Area" function?
And in the display function, why $c?
I am just looking for more info on the actual editable region options....
Now i have seen this example:
<? $a = new Area('Main'); $a->display($c); ?>
Now in dissecting that code... The "Main" - is that just a unique identifier? Is there a list of options for the "Area" function?
And in the display function, why $c?
I am just looking for more info on the actual editable region options....
$c is the collection which uniquely identifies the page & the area name "Main" identifies the section of the page.
Those are arguments so that you could display contents of the area from another page by passing in the correct Collection object.
In general, when building custom templates you can just name the areas whatever makes sense to you.
Those are arguments so that you could display contents of the area from another page by passing in the correct Collection object.
In general, when building custom templates you can just name the areas whatever makes sense to you.
Thanks for the additional info.
Now when does "$c" get created? What exactly is being referenced in $c? I mean I understand that $a is an instance of the Area object, but it is $c, i am not quite following.
Is $c something that is used by concrete5 and in initiated somewhere else in the framework?
Or could $c be anything I wanted to put in there? IE. $xyz, $mypage, $mycollection, etc?
Sorry if these are dumb questions... just started with this CMS the day I posted this thread.
Thanks in advance.
Now when does "$c" get created? What exactly is being referenced in $c? I mean I understand that $a is an instance of the Area object, but it is $c, i am not quite following.
Is $c something that is used by concrete5 and in initiated somewhere else in the framework?
Or could $c be anything I wanted to put in there? IE. $xyz, $mypage, $mycollection, etc?
Sorry if these are dumb questions... just started with this CMS the day I posted this thread.
Thanks in advance.
$c is created by the framework. It's a collection object for the current page.
you could certainly reference the collection object for a different page in your code.
you could certainly reference the collection object for a different page in your code.
<? // $cID 1 is allways the home page $homePage = Collection::getByID(1); echo $homePage->getCollectionName(); ?>
yes here it is:
http://www.concrete5.org/help/building_with_concrete5/developers/th...
$c is collection.
Greetz