Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » Detect the display size
Detect the display size
Re: Detect the display size
Hi,
unfortunately, web sites don't get sent any information about the display size, when the visitor visits for the first time. MetaMod therefore has no info to act on.
It's possible for a page *response* from Joomla (i.e. after the initial page response) to contain some JS code that can get the display size and transmit that back to the Joomla site, e.g. in an AJAX request, or in a normal page request (e.g. page refresh) in the URL or in a cookie. In that case MetaMod can pick up on it, but can you see the problem... this can't happen on the very first page request that Joomla receives from the visitor's browser.
Request /
... Joomla & MetaMod have no info about display size. Respond with HTML page that includes JS snippet
Browser renders page with JS. JS detects display size and sets in cookie
User requests 2nd page (clicks on link from 1st page)
... Joomla & MetaMod receive request that contains cookie with display size, and respond with new page with modules modified according to that size.
Therefore it's not really an easy thing to achieve well unless you can crack the "1st page" problem. If you can think of a good way to fix that please let me know, I'd love to have a solution.
Thanks
Stephen
- Index
- » MetaMod
- » MetaMod General Support
- » Detect the display size
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5942
- Posts this week:
- 2
- User Info:
- Total Users:
- 7633
- Newest User:
- mingle7855
- Members Online:
- 0
- Guests Online:
- 177
- Online:
- There are no members online
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked