R
R
ross_viktor2019-10-21 16:55:09
Code::Blocks
ross_viktor, 2019-10-21 16:55:09

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}

or how to organize it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vitaly Stolyarov, 2018-08-11
@Ni55aN

The header file was not found for one of two reasons:

  1. it doesn't exist in any of the standard paths .
    Solution: install IL in the standard path
  2. did not include the directory, * where you put the IL directory with .h files
    Solution: set the path to the directory *

S
SagePtr, 2019-10-21
@SagePtr

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 question

Ask a Question

731 491 924 answers to any question