Jump to content
Sign in to follow this  
seotime

Создание макета. Прошу помощи.

Recommended Posts

Здравствуйте. 

Задача не простая, а очень простая,но не могу создать новый макет страницы. 

Имеется Opencart 2,3,0,2 шаблон so-furnicom, сайт

Необходимо сделать страницу копию common/home, доступна по адресу напр. common/categorywall

Делаю так: в /catalog/controller/common создаю categorywall.php (содержимое home.php, меняю наименование класса на CommonCategoryWall и в конце common/categorywall)

<?php
class ControllerCommonCategoryWall extends Controller {
	public function index() {
		$this->document->setTitle($this->config->get('config_meta_title'));
		$this->document->setDescription($this->config->get('config_meta_description'));
		$this->document->setKeywords($this->config->get('config_meta_keyword'));

		if (isset($this->request->get['route'])) {
			$this->document->addLink($this->config->get('config_url'), 'canonical');
		}

		$data['column_left'] = $this->load->controller('common/column_left');
		$data['column_right'] = $this->load->controller('common/column_right');
		$data['content_top'] = $this->load->controller('common/content_top');
		$data['content_bottom'] = $this->load->controller('common/content_bottom');
		$data['footer'] = $this->load->controller('common/footer');
		$data['header'] = $this->load->controller('common/header');

		$this->response->setOutput($this->load->view('common/categorywall', $data));
	}
}

В /template/common  создаю tpl (содержимое home.tpl)

<?php echo $header; ?>

<?php 
    require_once(DIR_SYSTEM . 'soconfig/classes/soconfig.php');
    if(isset($registry)){$this->soconfig = new Soconfig($registry);}
?>
<?php 
    //Select Type Of Header
    if(isset($typelayout)){
        switch ($typelayout) {
        case "1":
            include(DIR_TEMPLATE.$theme.'/template/home/home1.tpl');break;
        case "2":
            include(DIR_TEMPLATE.$theme.'/template/home/home2.tpl');break;
        }
    }else{
       /* Здесь говорит что не существующая страница или дирректория */  include(DIR_TEMPLATE.$theme.'/template/home/home1.tpl');
    }
?>

<?php echo $footer; ?>

И создаю макет путь - common/categorywall

 

Но выдаёт ошибку несушествующей страницы (но она-то есть и в home всё работает) - подскажите что не так? 

Share this post


Link to post
Share on other sites

Взял с tpl с дефолтного opencart - заработало. 

<?php echo $header; ?>
<?php echo $column_left; ?>
<?php echo $column_right; ?>
      <div id="content">
           <?php echo $content_top; ?>
           <h1 style="display: none;"><?php echo $heading_title; ?></h1>
           <?php echo $content_bottom; ?>
     </div>
<?php echo $footer; ?>

 

Share this post


Link to post
Share on other sites

достаточно статью пустую создать

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.