Install single page from package installer
Permalink
Hi there,
I am currently trying to create my own package and so far it seems fine, but I cannot get it to install a single page. The class SinglePage does not seem to be loaded at this point, so I cannot call SinglePage::add().
Can you please tell me how to do so? I tried to find a way, but failed epicly. Then I tried to find an example on the market place, but the only packages that I assume to offer single pages are payware, so I cannot take a quick look on how it works.
If its of interest: It has to be a single page for the dashboard.
Thanks in advance
Arne
I am currently trying to create my own package and so far it seems fine, but I cannot get it to install a single page. The class SinglePage does not seem to be loaded at this point, so I cannot call SinglePage::add().
Can you please tell me how to do so? I tried to find a way, but failed epicly. Then I tried to find an example on the market place, but the only packages that I assume to offer single pages are payware, so I cannot take a quick look on how it works.
If its of interest: It has to be a single page for the dashboard.
Thanks in advance
Arne
check out concrete/controllers/install.php for the correct syntax.
This helps a lot. Got it running now by doing the following:
Loader::model('single_page');
$spPath = "/dashboard/akb_news";
$sp = SinglePage::add($spPath, $pkg);
$sp->update(array('cName'=>t('News'), 'cDescription'=>t('Manage your news.')));
Works like a charme :)
Loader::model('single_page');
$spPath = "/dashboard/akb_news";
$sp = SinglePage::add($spPath, $pkg);
$sp->update(array('cName'=>t('News'), 'cDescription'=>t('Manage your news.')));
Works like a charme :)