public function indexAction()
 {
     $this->_helper->layout()->setLayout('redesign-2014');
     $Page = new Model_Page();
     if ($this->_getParam('pid') == 'index') {
         //$this->_redirect('/');
     }
     $pagedata = $Page->Display($this->_getParam('pid'));
     if (!$pagedata) {
         //check if product url
         $products = new Model_Products();
         $product = $products->ListProductByURL($this->_getParam('pid'));
         if ($product) {
             $this->_helper->layout()->setLayout('redesign-2014-product');
             $product_id = $product['ProductID'];
             $this->view->data = $product;
             $this->view->images = $products->DisplayProductImages($product_id);
             $this->view->pagetype = "product";
             $this->view->product_page = 1;
             $this->view->site_title = $product['Name'];
             $this->view->product_categories = $products->DisplayProductCategories($product_id);
             $this->view->product_attributes = $products->DisplayProductAttributes($product_id);
             $this->render('product');
         } else {
             throw new Zend_Controller_Action_Exception('This page does not exist', 404);
         }
     } else {
         $this->view->pagetype = "page";
         $this->view->data = $pagedata;
     }
     if ($pagedata['PageType'] == 'About') {
         $site = new Model_Site();
         $this->view->blurb_1 = $site->widget_blurb("Who We Are");
         $this->view->blurb_2 = $site->widget_blurb("Our Mission");
         $this->render('about');
     }
     if ($pagedata['PageType'] == 'Contact') {
         $this->render('contact');
     }
 }
 public function productsdisplayAction()
 {
     //$this->_helper->layout()->setLayout('admin');
     $products = new Model_Products();
     $generic = new Model_Generic();
     $categories = new Model_Categories();
     $product_id = $this->_getParam('pid');
     $this->view->data = $products->ListProducts($product_id);
     $this->view->images = $products->DisplayProductImages($product_id);
     $this->view->product_attributes = $products->DisplayProductAttributes($product_id);
     $this->view->product_categories = $products->GetProductTreeIDs($product_id);
     $this->view->Brands = $generic->getData("Brands");
     #$this->view->Categories = $generic->getData("Category","","Name asc");
     $this->view->category_tree = $categories->listCategoryTree();
     $this->view->orphan_categories = $categories->listOrphanCategories();
     $this->render('productscreate');
 }