What is Collection?

Permalink
Hi All!

What is the Collection? How this part works and how can it be usable and also from where can i learn it completely?

 
ScottC replied on at Permalink Best Answer Reply
ScottC
from my understanding, a Collection is the base class that a Page inherits from(extends or whatever) so Collections have a base class, a PageID has the same CollectionID, and so you can think of a Collection as basically a cID as the key, you have base attributes(cName, cDescription, cDatePublic) as part of the class, other ones you add are CollectionAttributes and are not required to be present.

A Collection appears to be boiled down to the really basic details of a base page mapped to Areas(the things blocks belong to), and your versioning of pages is tied to collection versions, which are associated to the initial base collection you created.

For all intents and purposes you usually always interact with the Page object so Collections are just really organization things? That make any kind of sense?

what I mean is if you look at an area:

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


that $c is the currentPage/Collection object

meh, right?

Now how about doing:

$footer = new Area('footer');
$a->display(Page::getByID(HOME_CID); ?>

On some other page? That $a->display( is being passed in a collection that isn't the current page, but it still renders since it pulls in THAT collections area(not the current one that is being rendered) which makes me think of them as holders of the areas as their main purpose.

This is getting long-winded, sorry. Hope that helped.

tldr; use Pages, not Collections.
savan replied on at Permalink Reply
Hi ScottC,

I got your answer thanks for your help to get me clear with the collection part

I have one more question related to the collection so if you can help me in that

-As i saw that the many blocks use the collection to save the data so can we save any type of data by using the default collection and is it possible to create any more type of collection if we need and if yes then how can it be done?

I am sory if i have asked anything silly but if you can help me in it , it will be much helpful to me