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.

 

Serve mobile page without desktop weight

Serve mobile page without desktop weight

Hi,
I'm looking to find a solution for this issue.  Though Chameleon might be it?
I have a site Professional Soccer Coaching that has a desktop that is loading fast and passes the Google Pagespeed assessments and the mobile version is in contrast VERY slow on Pagespeed  score.

With Chameleon would I be able to serve the same template I have but without all the hidden load that its trying to load from the mobile version.  A developer told me that the desktop modules are still being loaded even though they are hidden on mobile.

Let me know if you think this would help. To serve the mobile version without the desktop weight (module, plugins)
Darren

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

Re: Serve mobile page without desktop weight

Hi Darren,

It may help, but the issue is being able to accurately detect when the viewer is on a mobile device. The detection inside Chameleon is reasonable but isn't perfect. It works on browser detection (user agent strings) which is a blunt approach. Ideally you'd want JS-based feature detection that perhaps sets a cookie which Chameleon then picks up and uses to change things on your page. Why does this matter? Partly because the definition of "mobile" is not straight forward. Is it about small displays? Slow speed mobile networks? Slow processors? These things can't be ascertained by user agent strings alone and probably can only be done with custom JS.

Caveats aside, let's say you do want to use the Mobile detection inside Chameleon. Here's one way you can do it:

* Let's say the main task is to prevent some modules from appearing on Mobile.
* Modules can have visibility for different view levels. These view levels are combinations of user groups.
* Therefore if a user has (or appears to have) a certain view level, the module can be switched on or off accordingly.
* Chameleon can use this process to switch modules on an off for a viewer, by dynamically adding the current user to a user group. It doesn't permanently affect the user account (it even works for non logged in users); it just "virutally" adds that user group for that user in the current session.

- create a user group called Desktop
- create a view level called Desktop, that contains only the user group "Desktop".
- if you ever need to restrict modules to other view levels, you may need to create more view levels that combine "Desktop" and other user groups.
- edit each of the modules you want to be Desktop Only, and set them to view level "Desktop"

- in Chameleon, make a rule that detects "Mobile" (in Environment section, "Browsers" = "Mobile devices (not incl tablets)")
- the action for that rule is a "fail" action: Add to user group(s)=Desktop

Ok, so what happens is that when a page is requested, Chameleon says "is it mobile"? If NOT, then it adds the user group "Desktop" to the current user.
Then the current user is automatically part of the "Desktop" view level. And only modules available to "all" or "Desktop" will be added to the page.

I trust that helps.

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
3312 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1666
Total Polls:
6
Total Posts:
5909
Dormant:
User Info:
 
Total Users:
10095
Newest User:
johnson58
Members Online:
0
Guests Online:
226

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