This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getAllPagesList($parent,$type) { | |
$page_list = new PageList(); | |
$page_list->filterByParentID($parent->getCollectionID()); | |
$page_list->sortByName(); | |
$page_list->filterByCollectionTypeHandle($type); | |
$template_pages = $page_list->get(); | |
$return_data = array(); | |
foreach ($template_pages as $template_page) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$nav = Loader::helper('navigation'); | |
$page = Page::getByPath('/about-us'); OR $page = Page::getByID($page_id_here); | |
$url = $nav->getCollectionURL($page); | |
//BONUS breadcrumbs :) | |
$breadcrumbs = $nav->getTrailToCollection($page); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $u; | |
$db = Loader::db(); | |
$a = "INSERT INTO exampleTable(uID,completed) VALUES('$u->uID','false')"; | |
$b = $db->query($a); | |
$c = $db->insert_ID(); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Get Send Update URL | |
$wanted_page = Page::getByPath('/path/goes/here'); | |
$url_helper = Loader::helper('navigation'); | |
print_r($url_helper->getCollectionURL($wanted_page)); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//In The View | |
$this->getBlockURL(); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$bv = new BlockView(); | |
$bv->setBlockObject($this->getBlockObject()); | |
$blockURL = $bv->getBlockURL(); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Loader::model('file_list'); | |
$fl = new FileList(); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<field name="columnNameHere" type="C" size="255"/> | |
//If you forget to add the size property, c5 will fail to update the DB table |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Use this function inside your controller to have it fire when you load the block. | |
//You can call any method inside the class, including action methods | |
public function on_start(){} | |
//This function fires when the view is rendered | |
//Use this function when you want to pass controller variables to the view | |
public function view(){} |
OlderNewer