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
thanks
just adding it in the themes folder with the default and view should do it,
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
i think it does it automatically,
that's what I thought to, but it didn't install the pagetype
whats the page type called?
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.
If I copy the theme int themes i get prompted if I want to add folio.
try to click on the inspect button next to ur theme.
and you might have to inspect it.
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.
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]
[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]