Jump to content

Создание страницы tpl 1.7.2


Recommended Posts

Добрый день! Необходимо добавить ряд своих страниц в шаблон, после многочисленных поисков нашел лишь пару статей.
Делал по инструкции:
1. Создал подпаку в themes/mytheme/templates/about
2. Создал контроллер в controllers/front/

<?php

class MypageControllerCore extends FrontController
{
	public $php_self = 'about-us';
	
	public function init() {
		parent::init();
	}

	public function initContent() {
		parent::initContent();
		$this->setTemplate(_PS_THEME_DIR_.'about-us.tpl');
	}
}

3. В Seo и Url добавил созданную страницу.

 

А что дальше? 

 

Вариант с созданием страницы через "Дизайн->Страницы" не подходит, т.к он обрезает иконки и сам контейнер не подходит под стилистику страницы

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

Добрый день! Необходимо добавить ряд своих страниц в шаблон, после многочисленных поисков нашел лишь пару статей.

Делал по инструкции:

1. Создал подпаку в themes/mytheme/templates/about

2. Создал контроллер в controllers/front/

<?php

class MypageControllerCore extends FrontController
{
	public $php_self = 'about-us';
	
	public function init() {
		parent::init();
	}

	public function initContent() {
		parent::initContent();
		$this->setTemplate(_PS_THEME_DIR_.'about-us.tpl');
	}
}

3. В Seo и Url добавил созданную страницу.

 

А что дальше? 

 

Вариант с созданием страницы через "Дизайн->Страницы" не подходит, т.к он обрезает иконки и сам контейнер не подходит под стилистику страницы

 

Вот мой пример подключения страницы для 1.7

class BoninstagramcarouselInstagramModuleFrontController extends ModuleFrontController
{
public function initContent()
{
parent::initContent();
$this->context = Context::getContext();
$class = new Boninstagramcarousel();

if (Configuration::get('BONINSTAGRAMCAROUSEL_DISPLAY')) {
$this->context->smarty->assign('limit', Configuration::get('BONINSTAGRAMCAROUSEL_PAGE_LIMIT'));
$this->context->smarty->assign('instagram_param', $class->getInstagramContent());
}

if (_PS_VERSION_ >= 1.7) {
$this->setTemplate('module:boninstagramcarousel/views/templates/front/instagram_1_7.tpl');
} else {
$this->setTemplate('instagram.tpl');
}
}
}
Edited by BonPresta (see edit history)
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...