concrete5.7 Pagination
https://github.com/hissy/concrete5-5.7.0/commit/9d14c9a6edf79736efa1689e5e2a0d6e459fc946
| <?php | |
| // 参考: http://ja.katzueno.com/2014/05/3104/ | |
| // テーマ埋め込みの場合 | |
| <a href="<?php echo $this->url('/login', 'forward') . $c->getCollectionID() . '/';?>">ログイン</a> | |
| <?php | |
| // テーマ以外で埋め込みの場合 | |
| $c = Page::getCurrentPage(); // テーマだったら代入されているはずなのでここの行は必要ないです | |
| ?> |
| <?php | |
| $ms = \Concrete\Core\Multilingual\Page\Section\Section::getCurrentSection(); | |
| if (is_object($ms)) { | |
| if ($ms->getLocale() == 'en_US') { | |
| $a = new GlobalArea('Global Nav English'); | |
| } | |
| } | |
| if (!is_object($a)) { | |
| $a = new GlobalArea('Global Nav'); | |
| } |
| // 5.6 の場合 | |
| Loader::model('page_list'); | |
| $pl = new PageList(); | |
| $pl->filterByAttribute('attr_name','attr_value','like'); | |
| echo $pl->getTotal(); | |
| // 5.7 でトピック属性 | |
| // /application/blocks/topic_list/view.php | |
| // クラスを読み込み |
| <?php | |
| namespace Concrete\Controller\Search; | |
| use Concrete\Core\Http\ResponseAssetGroup; | |
| use Controller; | |
| use FileList; | |
| use \Concrete\Core\Search\StickyRequest; | |
| use \Concrete\Core\File\Search\ColumnSet\ColumnSet as FileSearchColumnSet; | |
| use \Concrete\Core\File\Search\Result\Result as FileSearchResult; | |
| use FileAttributeKey; |
| <?php | |
| defined('C5_EXECUTE') or die("Access Denied."); | |
| $th = Loader::helper('text'); | |
| $c = Page::getCurrentPage(); | |
| $dh = Core::make('helper/date'); /* @var $dh \Concrete\Core\Localization\Service\Date */ | |
| ?> | |
| <? if ( $c->isEditMode() && $controller->isBlockEmpty()) { ?> | |
| <div class="ccm-edit-mode-disabled-item"><?=t('Empty Page List Block.')?></div> | |
| <? } else { ?> |
| <?php | |
| defined('C5_EXECUTE') or die("Access Denied."); | |
| $th = Loader::helper('text'); | |
| $c = Page::getCurrentPage(); | |
| $dh = Core::make('helper/date'); /* @var $dh \Concrete\Core\Localization\Service\Date */ | |
| ?> | |
| <? if ( $c->isEditMode() && $controller->isBlockEmpty()) { ?> | |
| <div class="ccm-edit-mode-disabled-item"><?=t('Empty Page List Block.')?></div> | |
| <? } else { ?> |
| <?php | |
| $page = Page::getByID(1); // cID で指定したページのオブジェクトを指定 | |
| $blocks = $page->getBlocks("Main"); // 指定した「Main」エリアのブロックの情報を取得 | |
| if ($blocks) { | |
| foreach($blocks as $block) { | |
| echo h($block->bID) . ", "; | |
| } | |
| } |