Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

Detect the display size

Detect the display size

I would like to determine the size of the display to exclude a certain module in small display.
Thanks

zionshea
Beginner Modder
ranks
useravatar
Offline
1 Posts
Administrator has disabled public posting

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

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3314 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1691
Total Polls:
6
Total Posts:
5912
Total Posts Today:
6
User Info:
 
Total Users:
11527
Newest User:
david9684
Members Online:
3
Guests Online:
175


Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked