Mobile template is not loading

Dustin Hansen's Avatar

Dustin Hansen

Feb 21, 2012 @ 09:50 PM

We have an issue where a specific template won’t load correctly. Here’s a look at our template structure:

c

 - index

core*

 - index

mobile__c

 - index

mobile__core

 - index

core/index is our home page. This is loading the mobile template just fine. c is our category page. When we try to load /c/brushes, for example… the desktop version is getting served up. It’s not pulling from mobilec. If enter the URL as /mobilec/brushes, I'll get the mobile template. It seems like the extension isn't working.

Thoughts? We’re in a bit of a pinch here with this site to launch in pretty short order.

Using EE 2.3.1 and Mobile 0.8.7

  1. Support Staff 1 Posted by Wouter Vervloet on Feb 21, 2012 @ 10:42 PM

    Wouter Vervloet's Avatar

    Do you have Freebie installed? If not, could you try it and set the "break on segment" to 'c'?

    – Wouter

  2. 2 Posted by Dustin Hansen on Feb 21, 2012 @ 11:52 PM

    Dustin Hansen's Avatar

    Freebie is not installed. I can give it a try. It's not working for template group mobile__p either (our product page). Is Freebie a requirement for this aspect of the module to work? Right now we are just using {if is_mobile} to achieve our needs and for us, that might be the more elegant solution.

  3. Support Staff 3 Posted by Wouter Vervloet on Feb 26, 2012 @ 10:25 PM

    Wouter Vervloet's Avatar

    Hi Dustin,

    I did some thinking and I think I figured it out. In your case, when accessing /c/brushes, Mobile is looking for a template called /mobile__c/brushes which, probably doesn't exist at all since you're routing everything through the index template.

    Is this correct?

    – Wouter

  4. 4 Posted by Dustin on Feb 27, 2012 @ 08:54 PM

    Dustin's Avatar

    Hi Wouter,

    Sorry for my delay in getting back to you on this. I appreciate the follow up.

    Yes, what you describe is accurate. We have the desktop version set up so that when /c/brushes is requested, it looks for the template "c/brushes". If that doesn't exist, it loads "c/index". I am trying to track down how we did this without Freebie. So far I've come up empty.

  5. Support Staff 5 Posted by Wouter Vervloet on Feb 28, 2012 @ 07:07 PM

    Wouter Vervloet's Avatar

    Well, it's not that weird actually since by default EE falls back to the index template in a template group if a specific template is not found.

    If you install Freebie and you set the breaking segment to c it should all work fine.

    Breaking segments

    You will, however, need to swap all the {segment_2} variables in your index template to {freebie_2} since Freebie hides those segments for EE (and Mobile).

    Just curious though... is 'c' by any chance your category indicator for EE?

    – Wouter

  6. 6 Posted by Dustin Hansen on Mar 08, 2012 @ 05:32 PM

    Dustin Hansen's Avatar

    I've had to install Freebie to the site for other purposes and since then I'm noticing even more areas of the site where the mobile template isn't being loaded correctly. I have to do a check on every page with {if is_mobile} to serve up the right template. It's not happening automatically. Another example:

    cleaning-corner
    - index - tips mobile__cleaning-corner
    - index - tips

    Bringing up /cleaning-corner/tips on mobile is pulling up the desktop version, not the mobile version. The "cleaning-corner" URL segment is not setup in any special way that I'm aware of.

  7. 7 Posted by Dustin Hansen on Mar 08, 2012 @ 05:34 PM

    Dustin Hansen's Avatar

    I believe it's happening to all URLs now. None of them are automatically loading the mobile template.

  8. Support Staff 8 Posted by Wouter Vervloet on Mar 08, 2012 @ 10:00 PM

    Wouter Vervloet's Avatar

    Hi Dustin,

    Would it be possible for me to take a look at the site (and backend) so I can see what might be going wrong?

    Just an heads-up, don't reply to this mail with any credentials as this thread is automatically posted to the support forum. If you want to send me any login info, send it to wouter [at] baseworks [dot] nl

    – Wouter

  9. 9 Posted by Dustin Hansen on Mar 13, 2012 @ 03:22 PM

    Dustin Hansen's Avatar

    Hello,

    This email is in regards to the bug I posted here: http://support.baseworks.nl/discussions/mobile/27-mobile-template-is-not-loading. You requested I contact you via email.

    The Mobile plugin is not redirecting to the mobile templates properly. I have to manually check {if is_mobile} to serve up the correct content. It also means I can't use the "{mobile:switch_to_full}" link.

    Here are the login details you requested:

    [REMOVED]

    I have set up a very simple example for you to see. Check out the URL http://www.ocedar.com/xxyyzz. I have two templates set up:

    xyyzz
     - index (outputs "DESKTOP" to the screen)
    mobile__xxyyzz
     - index (outputs "MOBILE" to the screen)

    You can see that the mobile version is not loading correctly.

    Please take a look when you have a chance? Thanks very much.

    --
    Dustin Hansen | Sr. Application Architect, Interactive | Upshot | 350 N. Orleans, 5th Floor, Chicago, IL 60654
    p: 312.895.6250 | f: 312.943.9699 | [email blocked]<mailto:[email blocked]> | www.upshot.net

  10. Support Staff 10 Posted by Wouter Vervloet on Mar 13, 2012 @ 06:41 PM

    Wouter Vervloet's Avatar

    Hi Dustin,

    I figured out where things where going wrong… it seems Freebie changed something in their configuration, because it was overriding the Mobile actions.

    I changed the priority of the Mobile extension in the database so it is working again, but you'll need to download a new version of Mobile to be on the safe side. You can grab v0.8.8 from the GitHub repository.

    Could you check if everything is working again?

    – Wouter

  11. 11 Posted by Dustin on Mar 13, 2012 @ 08:05 PM

    Dustin's Avatar

    This is working great now. Thanks so much! Sorry for the delay in getting you the information you needed. Nice work on this extension.

  12. Support Staff 12 Posted by Wouter Vervloet on Mar 13, 2012 @ 08:08 PM

    Wouter Vervloet's Avatar

    I'm glad everything is working now.

    – Wouter

  13. Wouter Vervloet closed this discussion on Mar 13, 2012 @ 08:08 PM.

  14. Dustin re-opened this discussion on Mar 15, 2012 @ 04:32 PM

  15. 13 Posted by Dustin on Mar 15, 2012 @ 04:32 PM

    Dustin's Avatar

    Hello,

    It looks like our original issue is still occurring. Most templates are pulling the mobile site, but /c is not working correctly. Thoughts on why this is?

    /c/brushes should load mobile__c/index, but it's pulling c/index instead.

    Is this expected behavior? Do you still recommend adding the "c" segment to Freebie as the solution to this?

  16. 14 Posted by Dustin Hansen on Mar 15, 2012 @ 04:49 PM

    Dustin Hansen's Avatar

    Hi Wouter,

    I tried to respond on the forum but it wouldn't let me because the
    discussion is closed, but my original issue still remainsŠ

    Most templates are pulling the mobile site, but /c is not working
    correctly. Thoughts on why this is?
    /c/brushes should load mobile__c/index, but it's pulling c/index instead.

    Is this expected behavior? Do you still recommend adding the "c" segment
    to Freebie as the solution to this?

    --
    Dustin Hansen | Sr. Application Architect, Interactive | Upshot | 350 N.
    Orleans, 5th Floor, Chicago, IL 60654
    p: 312.895.6250 | f: 312.943.9699 | [email blocked] |
    www.upshot.net

  17. Support Staff 15 Posted by Wouter Vervloet on Mar 15, 2012 @ 07:45 PM

    Wouter Vervloet's Avatar

    I know why it is happening, so I'll see if I can implement a quick fix for you.

    – Wouter

  18. Support Staff 16 Posted by Wouter Vervloet on Mar 15, 2012 @ 08:45 PM

    Wouter Vervloet's Avatar

    Hi Dustin,

    I just pushed a new version to GitHub (v0.9) which should solve your problem with the /c/lorem not working.

    https://github.com/AboutWout/mobile.ee2_addon

    I've done some quick tests here and it all seems to work.

    – Wouter

  19. Wouter Vervloet closed this discussion on Jul 14, 2012 @ 11:14 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac