public function action_categories() { $list = array(); $page = Page_Route::page_by_alias('news'); if (!empty($page)) { $news_category = new News_Category(); $list = $news_category->get_list($page['id']); } $this->template = View_Theme::factory('widgets/template/news/categories', array('list' => $list, 'page' => $page)); }
<?php defined('SYSPATH') or die('No direct script access.'); $page = Page_Route::page_by_alias('catalog'); if (empty($page) or empty($list)) { return; } ?> <div class="container"> <div class="sixteen columns"> <h3 class="headline"><?php echo __('Best deals'); ?> </h3> <span class="line margin-bottom-0"></span> </div> <div class="sixteen columns products" style="margin-left: 0;"> <?php $detail_tpl = URL::base() . Page_Route::uri($page['id'], 'catalog_element', array('element_uri' => '{ELEMENT_URI}', 'element_id' => '{ELEMENT_ID}')); $orm_helper = ORM_Helper::factory('catalog_Element'); foreach ($list as $_orm) { $_link = str_replace(array('{ELEMENT_URI}', '{ELEMENT_ID}'), array($_orm->uri, $_orm->id), $detail_tpl); $_thumb_1 = NULL; if (!empty($_orm->image_1)) { $_src = $orm_helper->file_uri('image_1', $_orm->image_1); $_thumb_1 = Thumb::uri('list_420x535', $_src); unset($_src); } else { $_thumb_1 = Thumb::uri('list_420x535_no_img', $NO_IMG); } $_thumb_2 = NULL;