Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Разные шаблоны для главных и вложенных категорий.


Recommended Posts

Можно ли как то отделить шаблоны .tpl главных категорий от вложенных?

Появилась такая необходимость, что бы получить более вариативности в настройке и дизайне именно главной категории.
Или может есть какие то другие идеи...?!

Link to comment
Share on other sites


Ждал тут комментариев и сам придумал реализацию.
В категории добавил чекбокс (Отмечаю если главная категория). В БД oc_category добавил поле main для сохранения значения чекбокса: 0 или 1

В контролере подставляю один из двух шаблонов в зависимости от значения переменной, в которой 0 или 1

Нормальная реализация, как считаете?

Link to comment
Share on other sites


15 минут назад, s89 сказал:

В категории добавил чекбокс (Отмечаю если главная категория).

Работает?

 

я бы 

 

if (count(explode('_'.$this->request->get['path'])) = 1) { main }
 

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
 Share

×
×
  • Create New...

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.