Answer the question
In order to leave comments, you need to log in
How to disable data output in smarty at a resolution of more than 600px?
hello, what can you think of so that smart does not display an array at all in the template if the screen resolution is more than 600px? maybe you can somehow determine the screen size through js and substitute something like
{if (!isset($cat)) || !$cat > (сюда подставить значение (601) }
{else}
0
{/if}
Answer the question
In order to leave comments, you need to log in
The header file was not found for one of two reasons:
No, because Smarty runs on the server, and the screen resolution only exists on the client. Is it possible to form an ajax request through JS and substitute the screen resolution as a parameter there, and on the PHP side, already look at the resolution parameter, pass it to Smarty and, based on it, either display the necessary data or not display it.
If this is for "display the menu" - then it's better not to bother, the overhead for executing an extra request will be higher than for parsing the menu in duplicate.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question