Page 1 of 2

Mobile extension

PostPosted: Sun Aug 15, 2010 9:14 pm
by hansfn
This is the discussion topic for the Mobile extension.

Visit http://extensions.pivotx.net/entry/34/mobile for download and more info.

Version 0.8 is last version.

Re: Mobile extension

PostPosted: Tue Dec 25, 2012 6:26 pm
by ptr
Since version: 0.7.2 it is not possible to test your mobile pages in a normal browser. The extension just shows the standard templates. In previous versions you just typed m.domainname.com and you would see the mobile pages.
Is this a bug or a feature? It's not very handy imho.

Re: Mobile extension

PostPosted: Wed Dec 26, 2012 10:25 am
by hansfn
If you don't change the user-agent of your browser (which is easily done with an extension if you use FF), you need to force mobile page - visit the site as m.example.org/?mobilecookie=1 This is the same trick that the mobilelink template tag uses.

The reason m.example.org doesn't always display the mobile pages is that some people want to display full/normal pages to tablets.

Re: Mobile extension

PostPosted: Thu Dec 27, 2012 1:51 pm
by ptr
Hans, I don't think this is a good thing. There is a feature in the mobile extension that let's you choose what version of the site tablet users see.

It's not a big problem though, I just switch back to version 0.6.

Re: Mobile extension

PostPosted: Thu Jan 03, 2013 12:12 am
by hansfn
ptr, sorry about the late reply. You are correct that the reasoning behind the change is bad - my memory wasn't correct. What we tried to fix was an issue were people used the mobile extension without having a separate domain (like m.example.org) - see revision 4075.

I agree that you should be able to visit a mobile sub domain (like m.example.org) with a normal browser and see the mobile site.

Could you please test version 0.7.2 again and replace

Code: Select all
    // Only run this hook if we are on a mobile device (or a tablet and we
    // treat it as a mobile).
    $allowTablet = ( isTablet() && !$PIVOTX['config']->get('mobile_treat_tablet_as_mobile') );
    if (!isMobile() || $allowTablet) {
        return;
    }

with

Code: Select all
    // If there isn't a separate mobile subdomain, only run this hook
    // on a mobile device (or a tablet and we treat it as a mobile).
    $canonical_domain = str_replace('http://', '', $PIVOTX['config']->get('canonical_host'));
    if ($PIVOTX['config']->get('mobile_domain') == $canonical_domain) {
        $allowTablet = ( isTablet() && !$PIVOTX['config']->get('mobile_treat_tablet_as_mobile') );
        if (!isMobile() || $allowTablet) {
            return;
        }
    }

in the function mobileHook in the file extensions/mobile/snippet_mobile.php.

Re: Mobile extension

PostPosted: Thu Jan 03, 2013 10:27 am
by Colp
Hi Hans,

Happy New Year to you...

I think I was the one who sparked off the revision 4075 and I'm really happy that you changed it. However, for some time I've noticed that the forcing a desktop to run the mobile view with ?mobilecookie=1 or ?mobilecookie=-1 doesn't work. It always displays the full desktop version. I thought I'd previously posted this, but it seems I haven't. Is that a bug?

Re: Mobile extension

PostPosted: Thu Jan 03, 2013 11:02 am
by hansfn
Colp, the change I suggested above (to ptr) is just about the problem/bug you mention. Please test and report back.

Added: OK, the problem you have is related, but not 100% the same as ptr. The change above is probably not enough for you. I'll post an update later today.

Added: OK, fixing the problem for Colp - viewing the mobile version in a desktop browser without having a separate mobile sub domain, is some work to fix. I just don't have time. Change the user-agent of your browser (using the User Agent Switcher extension if you are a FF user).

Re: Mobile extension

PostPosted: Fri Jan 04, 2013 10:57 pm
by Colp
Ok. Thanks for looking into it.

Re: Mobile extension

PostPosted: Sat Aug 24, 2013 4:27 pm
by Harm10
Version 0.8 has been released. Some improvements and the option to use mobile templates in the active weblog folder.

Re: Mobile extension

PostPosted: Mon Sep 02, 2013 11:28 pm
by Colp
Thanks for letting me know Harm. I've upgraded and I noticed that it has a new entry for 'archive template' - it was pointing to the wrong file so I've corrected that. I'm sticking with using a separate folder for my mobile template since I've got different images and CSS files, there isn't much point in combining them. I notice that the mobilecookie=-1 from the desktop browser still doesn't force a mobile view, but since Hans said it it wouldn't be fixed that's not a surprise - I have a separate weblog named 'mobile' to do that.

Cheers