Hello, I use div blocks on the main page. Favorites, Best, New, etc.
Blocks are responsive.
When screen width say 1280px and I call thumbs output <thumb num=1-35></thumb>
I have 5 rows and 7 columns and it's OK.
But when screen width 1024px I have last row with empty thumb cells.
Question : How can I send screen width in template to use php to control thumbs amount ?
I tried to use javascript to set screen width in cookie but this scheme doesn't works in the first page load.
Thumb output
Re: Thumb output
You should adjust it in html because
You'll have a problem in 1600 for example , there are a lot of resolution so you'll get a truncated row anyway
Also first of all a page is generated and served to a user and only after then JS that can detect a resolution, not other way around
You'll have a problem in 1600 for example , there are a lot of resolution so you'll get a truncated row anyway
Also first of all a page is generated and served to a user and only after then JS that can detect a resolution, not other way around
Don't forget to run script update
Re: Thumb output
But if I create file my.php
<script type="text/javascript">
document.cookie =
"sw=" + screen.width;
</script>
<?php
include('./scj/tube/index.php');
?>
I can detect width before page generation, write? But in same load session I can't read $_COOKIE['sw'] in template.
Second page load works great, then I can use php if with == n px -> output 1-n thumbs
Maybe I can send width in GET parameter ?
<script type="text/javascript">
document.cookie =
"sw=" + screen.width;
</script>
<?php
include('./scj/tube/index.php');
?>
I can detect width before page generation, write? But in same load session I can't read $_COOKIE['sw'] in template.
Second page load works great, then I can use php if with == n px -> output 1-n thumbs
Maybe I can send width in GET parameter ?
Re: Thumb output
No, most likely you don't understand the workflow of a webpage
Don't forget to run script update