Theme pagetype in package

Permalink
I'm making some packages for themes, I have on theme that has a different name than the default page types. How do I have the package add that new pagetype? something in the controller I would imagine!

thanks

pvernaglia
 
Mnkras replied on at Permalink Reply
Mnkras
just adding it in the themes folder with the default and view should do it,
pvernaglia replied on at Permalink Reply
pvernaglia
Yes, I can just add it to the themes directory, but I want it to install as a package like when you download from the marketplace
Mnkras replied on at Permalink Reply
Mnkras
i think it does it automatically,
pvernaglia replied on at Permalink Reply
pvernaglia
that's what I thought to, but it didn't install the pagetype
12345j replied on at Permalink Reply
12345j
whats the page type called?
pvernaglia replied on at Permalink Reply
pvernaglia
I have default, left_sidebar, full, view and folio.php All the others already exist with the default installation of C5, folio.php is in the themes directory. When I install as a package folio does not get installed. I'm thinking I need some sort of add page in the controller.

If I copy the theme int themes i get prompted if I want to add folio.
12345j replied on at Permalink Reply
12345j
try to click on the inspect button next to ur theme.
12345j replied on at Permalink Reply
12345j
and you might have to inspect it.
pvernaglia replied on at Permalink Reply
pvernaglia
Yeah, when I inspect the file is there with the option to activate it. But, there must be a way to activate it when the package installs so you can avoid this step.
pvernaglia replied on at Permalink Best Answer Reply
pvernaglia
Here's a solution that worked for me:

[code]

/* Check if page exists. */
Loader::model('collection_types');
$pageType = CollectionType::getByHandle('folio');

/* Addd new page if does not exist. */
if(!is_object($pageType)) {
$data['ctHandle'] = 'folio';
$data['ctName'] = t('Folio');
$newPage = CollectionType::add($data, $pkg);
}
[code]