A
A
Angry Negro2017-10-30 15:35:45
PHP
Angry Negro, 2017-10-30 15:35:45

How to make Prestashop display code using a call string like require (I hope I phrased it correctly)?

Friends! I have a question for those who are well versed in PrestaShop .
Actually .. The goal is very simple, but I don’t know how to implement it.
I have a menu written in html, it doesn't make sense to write a separate menu module.
But the bottom line is that this menu should be located in both cms.tpl and category.tpl , the menu is quite large. I change one point - I have to throw a new version with this line into the second file.
In php - a normal require function would solve all my problems. BUT - prestashop doesn't like php code in its tpl and will comment out everything php that gets into it (infection).
In other words, I want to transfer this menu to a separate file and call the contents of this file with a line like require. But how to do it in PrestaShop ?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Angry Negro, 2017-11-05
@TOA

{include file="$tpl_dir./menuart.tpl"}
Answer found. Thanks to me :)
Maybe someone will come in handy. The main thing, it turns out, was to write the file type: $tpl_dir

B
Barmunk, 2017-10-30
@Barmunk

smart dock
https://www.smarty.net/docsv2/en/language.function...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question