Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 29 MAR 2011 10:12:32AM Dave Harmacek wrote:

How does O4W v1.1 go about detecting a mobile browser?

I have an Android phone, Droid 2 Global, and the cookie "o4wMobile"

returns null whether I use the phone or the desktop browser to access a Wizard-based form. I have a template named m_.htm and it is not used in the Android diplay.

The browser header says "Mozilla/5.o (Linus; U; Android 2.2; en-us; DRIOD2 GLOBAL Build/S273) …"

Dave


At 29 MAR 2011 11:17AM bshumsky wrote:

Hi, Dave.

O4W doesn't, itself, detect whether the user is on a mobile browser (since I don't think there's a 100% reliable way to do that, cross-browser, yet). Instead, if _you_ (in your O4W application) set the o4wMobile cookie to a value of "1", then the built-in routine to load the default template will load the one marked as the "mobile default template" instead of the standard one.

The intent was that you would create a different "landing page" for mobile browser users, and from there you'd set the o4wMobile cookie (while users on non-mobile browsers would instead go to a different landing page that wouldn't set the o4wMobile cookie, or would set it to "0" instead of "1").

Hope that helps,

- Bryan Shumsky

Revelation Software

At 29 MAR 2011 11:40AM Dave Harmacek wrote:

So, how do I establish a "mobile landing page" for a wizard-based form?

On my desktop landing page I have a Submit button that sends:

https:slashslashwww.something.net/o4w/oecgi3.exe/O4W_RUN_FORM&INQID=MYFORM

I appended &o4wMobile=1

but that didn't start the mobile browser.

Dave


At 29 MAR 2011 01:25PM bshumsky wrote:

Hi, Dave. Appending the "o4wMobile" parameter to the end of the URL won't set it as a _cookie_. You need to set it via the O4WCookie API call.

By "landing page", I mean the URL that you'd hand out to folks to tell them where to go for your site - I'm assuming that you don't have them go right to the wizard-generated page? Instead, you'll send them to (say) a static page, or an O4W built page, with a menu? On _that_ page, you'll want to set the o4wMobile cookie to "1", so that when they then click on one of the menu choices that cookie is available inside O4W.

Or is your scenario different than what I've just described?

Thanks!

- Bryan Shumsky

Revelation Software

At 29 MAR 2011 04:10PM Dave Harmacek wrote:

I wrote an API routine that sets the cookie to '1' and then does a O4WRedirect to the form. The form appears, but isn't using the m_ template.

And, in that form I report the value of the o4wMobile cookie, and it returned a '1'.

Stumped,

Dave


At 30 MAR 2011 12:54AM bshumsky wrote:

Hi, Dave.

In the O4W routine that you redirect to, what does your O4WForm() call look like? Does it have an explicit template name to use, or is it blank (so that the default template is used)?

In your O4W Configuration screen, have you defined both the 'regular' and 'mobile' default templates?

Note, too, that depending on your browser, if you've "toggled" between regular and mobile templates, you may need to refresh your page so that the different template is used.

Thanks,

- Bryan Shumsky

Revelation Software

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/5cd8b1f1190483b085257862004e0d53.txt
  • Last modified: 2023/12/30 11:57
  • by 127.0.0.1