A
A
Angry Negro2017-06-12 19:51:15
Prestashop
Angry Negro, 2017-06-12 19:51:15

How to disable a module on all pages except the main one in Prestashop?

Friends, such a question..
There is such a wonderful tag for .tpl templates in Prestashop ^

{if $page_name == 'index'}
       . . .
{/if}

It allows you to display the element only on the main page. I need it. But damn, the problem:
It flatly does not work. Enabling it generally removes the element from all pages.
I wondered: "Perhaps my main page is being probed by the script as not being the main one."
Tried the display tag on a specific page only - nil response.
What could be the problem? What can be done?
All Google has re-Google'ed already. Nothing helped.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Ilyasov, 2017-06-13
@TOA

Weird. What you wrote above should work.
Well.. try this:

{if $smarty.server.REQUEST_URI == '/'}
       . . .
{/if}

In general, find out your "page name".
Add a variable to the tpl file {$page_name}and go to main.
Should be written INDEX then
{if $page_name == 'index'}
       . . .
{/if}
should work.
If there is another value, then write it in the tpl file:
{if $page_name == 'ваше_значение'}
       . . .
{/if}

A
Alex Art, 2017-06-21
@WebmasterW3S

Are you all out of your mind here? Go to Modules -> Block Locations. Select your module in the hook, click "Edit" and select exceptions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question