Example #1
0
 /**
  * Parse the page
  */
 protected function parse()
 {
     // add css
     $this->header->addCSS('/src/Frontend/Modules/' . $this->getModule() . '/Layout/Css/catalog.css');
     // add noty js
     $this->header->addJS('/src/Frontend/Modules/' . $this->getModule() . '/Js/noty/packaged/jquery.noty.packaged.min.js');
     // assign items
     $this->tpl->assign('products', $this->products);
     // flat array of categories
     $this->tpl->assign('categoriesFlat', $this->categories);
     // multidimensional array of categories
     $this->tpl->assign('categoriesTree', $this->categoriesTree);
     // multidimensional html list of categories
     $this->tpl->assign('categoriesHTML', FrontendCatalogModel::getTreeHTML($this->categoriesTree));
     // parse the pagination
     $this->parsePagination();
 }
Example #2
0
 /**
  * Parse the page
  */
 protected function parse()
 {
     // add css
     $this->header->addCSS('/src/Frontend/Modules/' . $this->getModule() . '/Layout/Css/catalog.css');
     // add noty js
     $this->header->addJS('/src/Frontend/Modules/' . $this->getModule() . '/Js/noty/packaged/jquery.noty.packaged.min.js');
     // add breadcrumbs
     $categories = FrontendCatalogModel::getAllCategories();
     $paths = FrontendCatalogModel::traverseUp($categories, $this->record);
     $baseUrl = FrontendNavigation::getURLForBlock('Catalog', 'Category');
     // get full urls
     $parentCategories = array();
     foreach ($paths as $key => $value) {
         $category = FrontendCatalogModel::getCategoryById($key);
         $breadcrumbPaths = FrontendCatalogModel::traverseUp($categories, $category);
         $url = implode('/', $breadcrumbPaths);
         $category['full_url'] = $baseUrl . '/' . $url;
         // add breadcrumb
         $this->breadcrumb->addElement($category['title'], $category['full_url']);
         $parentCategories[] = array('title' => $category['title']);
     }
     if (!empty($parentCategories)) {
         unset($parentCategories[count($parentCategories) - 1]);
     }
     if (!empty($parentCategories)) {
         $this->tpl->assign('parentCategories', $parentCategories);
     }
     // hide action title
     $this->tpl->assign('hideContentTitle', true);
     // show the title
     $this->tpl->assign('title', $this->record['title']);
     // set meta
     $this->header->setPageTitle($this->record['meta_title'], $this->record['meta_title_overwrite'] == 'Y');
     $this->header->addMetaDescription($this->record['meta_description'], $this->record['meta_description_overwrite'] == 'Y');
     $this->header->addMetaKeywords($this->record['meta_keywords'], $this->record['meta_keywords_overwrite'] == 'Y');
     // advanced SEO-attributes
     if (isset($this->record['meta_data']['seo_index'])) {
         $this->header->addMetaData(array('name' => 'robots', 'content' => $this->record['meta_data']['seo_index']));
     }
     if (isset($this->record['meta_data']['seo_follow'])) {
         $this->header->addMetaData(array('name' => 'robots', 'content' => $this->record['meta_data']['seo_follow']));
     }
     // assign items
     $this->tpl->assign('products', $this->products);
     $this->tpl->assign('record', $this->record);
     // flat array of categories
     $this->tpl->assign('subcategoriesFlat', $this->subcategories);
     // multidimensional array of categories
     $this->tpl->assign('subcategoriesTree', $this->subcategoriesTree);
     $this->tpl->assign('categoriesTree', $this->categoriesTree);
     // multidimensional html list of subcategories
     $this->tpl->assign('subcategoriesHTML', FrontendCatalogModel::getTreeHTML($this->subcategoriesTree));
     // parse the pagination
     $this->parsePagination();
 }