Hi, now I develop add-ons and need to add single page. The problem is I want add new single page and not listed in the sitemap. After looking the core code of concrete seems this feature not supported yet. This is what I know. Please let me know if I make mistake.
/*
* Adding single page when install
*/
$p = SinglePage::add('/store/services', $pkg);
if (is_object($p)) {
$p->update(array('cName' => t('Services'), 'cDescription' => t('c5commerce frontend web services')));
}
/**
* Code above will execute add method in the Single class -> /concrete/src/Page/Single.php
*
* Single class
*/
class Single {
// code
public static function add($cPath, $pkg = null) {
//code
$parent = CorePage::getByID(1);
//code
$newC = $parent->addStatic($data); //will execute static method in Page class -> /concrete/src/Page/Page.php
//code
}
//code
}
/**
* Page class
*/
class Page extends Collection implements \Concrete\Core\Permission\ObjectInterface {
//code
public function addStatic($data) {
//code
/*
* in line 2732 I just see cIsSystemPage value is harcode = 0, so I can not add from parameter. Add single page as system is illegal way..? or just not provided yet..?
*/
$cIsSystemPage = 0;
//code
$v = array($cID, $cFilename, $cParentID, $cInheritPermissionsFrom, $this->overrideTemplatePermissions(), $cInheritPermissionsFromCID, $cDisplayOrder, $cIsSystemPage, $uID, $pkgID);
$q = "insert into Pages (cID, cFilename, cParentID, cInheritPermissionsFrom, cOverrideTemplatePermissions, cInheritPermissionsFromCID, cDisplayOrder, cIsSystemPage, uID, pkgID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
$r = $db->prepare($q);
$res = $db->execute($r, $v);
//code
}
//code
}
Somebody can help me to suggest solution..? should I update database record manually..?