Welcome, Guest
Username Password: Remember me

Seeking advice re basic switching templates
(1 viewing) (1) Guest
  • Page:
  • 1
  • 2

TOPIC: Seeking advice re basic switching templates

Seeking advice re basic switching templates 14 years, 2 months ago #505

  • Sue
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
  • Karma: 0
Warning: aspiring novice, working outside skillset...

I've created two templates for my Joomla site - one regular, one iPhone-ready - and downloaded MobileJoomla! hoping it would detect when an iPhone was accessing the site and switch templates.

I have left most the settings alone, because frankly, they're a bit of a mystery to me - but updated the iPhone tab to point to the template I created, and set the homepage. (Just developing this at the moment - have no website to point you towards)

Have tested it using Mozilla's UserAgent tool (thanks for that advice) and no template switch is occurring. Have combed the forum and read the wiki several times, but seems most developers are taking advantage of the templates and other features you've provided - and that's where the majority of issues are occurring... Is this just too all-inclusive a tool? Should I be looking for a simple template-switching tool? Hoping you'll say no, have had no success with those either...

Thanks.

Seeking advice re basic switching templates 14 years, 2 months ago #2253

  • miohtama
  • OFFLINE
  • Expert Boarder
  • Posts: 112
  • Karma: 4
There are two places which affect template switching

* Components -> Mobile Joomla! -> Settings menu

* Extensions -> Plug in manager -> Mobile Always

Mobile Always determines what mark-up language or flavour is used. Each mark-up is associated with theme defined in Mobile Joomla! settings.

Hope this helps?

Seeking advice re basic switching templates 14 years, 2 months ago #2271

  • dishyzee
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
  • Karma: 0
I'm trying to understand how templates work in Mobile Joomla and also getting confused with Template switching. My install is Mobile Joomla 0.9.7 (I ignored warning that library GD2 is not loaded). It's on localhost. So given what I've read, my assumption is that template switching is intended to be dynamic ..

After some fiddling I get to glimpse a template by using localhost/site/index.php?template=mobile_iphone. Yes!

- but links from that page are always rendered using rhuk_milkyway *Grrr*
- attempt to use testiphone.com to see if user-agent triggers a template change, nope.
- try configuring menus to use Mobile Joomla but hit "Incorrect use of Mobile Joomla" error. Hmm

Dunno if this is related, but in Template Manager I notice that once Menu Assignment has been set to "None", it can't be reset to "Select from list". So now both mobile_iphone and mobile_imode are unassigned and I don't know how to get them back!

Components -> Mobile Joomla! -> Settings menu -> Disabled domain support

Extensions -> Plug in manager -> Mobile Always -> Enabled and set to Auto

thanks,
DishyZee

Seeking advice re basic switching templates 14 years, 2 months ago #2273

  • Barnabas
  • OFFLINE
  • Moderator
  • Posts: 329
  • Karma: 6
I haven't got a local host so I can't duplicate the setup you described, but I can give some clues to template switching.
Miohtama has identified, earlier in this post, the places that link templates to types of browser, this is just a description of how I see template switching in practice.
Assuming you would like the site accessible to both PC/laptop and mobile browsers.
There is one default template just like you had before you installed Mobile Joomla, and this will continue to be used by PC/laptop*. When you install Mobile Joomla, four extra templates appear in the template manager. These are not identified in any way in template manager, i.e. you do not select them here. You choose the template by parameters on the modules and MJ settings menu.
When Mobile Joomla detects a mobile browser, it chooses one of 4 types of browser (iPhone, imode, WAP, PDA) and sets a flag _MJ to say that a mobile browser is in use. During the cycle that Joomla! goes through when it's preparing to send output, it calls all of the enabled modules. If a module such as main menu (mod_mj_imode_menu) is called and MJ has determined that the browser is an imode type, then the position parameter of the module selects the template that will be used to display the output from that module.
Hope this helps you visualise how the templates are activated.

I have domain (multisite support) enabled rather than disabled as you described.
On my site, which is not a local host, I can force Firefox to show the different types of template by using
iphone.joomlasite.com or imode.joomlasite.com or pda.joomlasite.com or wap.joomlasite.com instead of www.joomlasite.com
(I had to install wmlbrowser and XHTML Mobile Profile to allow FF to display WAP)

Please describe where in Joomla! you configured menus to use Mobile Joomla but hit "Incorrect use of Mobile Joomla" error and I will try to advise.
Thanks

*Some Mac users have reported that a Safari browser is sometimes determined to be a mobile browser and displays the site as if on an iPhone instead of a laptop/mac.

Post edited to say modules rather than plugins. 17:32 BST.

Seeking advice re basic switching templates 14 years, 2 months ago #2278

  • miohtama
  • OFFLINE
  • Expert Boarder
  • Posts: 112
  • Karma: 4
Hi,

Thanks for your feedback.

We'll come up with a theming / template switching documentation which should help people with little Joomla! knowledge to spice up their Mobile Joomla! sites

Seeking advice re basic switching templates 14 years, 1 month ago #2281

  • dishyzee
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
  • Karma: 0
Thanks both for your feedback. It all makes sense and really helpful to see it spelled out.

The "Incorrect use .. " message appears (a) if you try to assign the templates using Template Manager or (b) if you try to hack a "template=moble_xx" into the query string of a particular menu. I guess they both amount to the same thing.

Interesting point about Mac users (I'm using Chrome on a Mac) although I'm seeing the PC version when I want a mobile one. Perhaps testiphone.com isn't working for me? Anyway I'm going to have a look at User-Agent tools, as mentioned by Sue and see if I can improve my development environment. Will let you know what happens.

DishyZee

Seeking advice re basic switching templates 14 years, 1 month ago #2283

  • Barnabas
  • OFFLINE
  • Moderator
  • Posts: 329
  • Karma: 6
To test what you experienced I installed Chrome on windows and installed the user agent switcher. Unfortunately the switcher does not have an iphone option under chrome so testiphone.com can't behave as if it were viewing the site as an iphone. Suggest you install firefox and user agent switcher. After you have added the addon, you need to move its icon to the toolbar by selecting view > toolbars > customise and dragging the earth symbol to your toolbar. Get the testiphone page up with www.testiphone.com/ then select iphone 3.0 from the user agent drop down menu and then type the url of the website into the testiphone page where it says iphone simulator. Then click enter. You should then see the site as if it were browsed by an iphone. If it doesn't work, then try putting www.mobilejoomla.com just to prove that you've set up the user agent switcher correctly.
You have to change the user agent switcher back to default before you look at other sites, otherwise they could all behave as if you were on an iphone. The testiphone.com is just making a small browser so it's more like an actual iphone. The user agent switcher is spoofing the string that identifies your browser to a website, so if the website understands it (like www.mobilejoomla.com) the website replies as if the browser were an iphone with a huge (for an iphone) screen.

Seeking advice re basic switching templates 14 years, 1 month ago #2284

  • dryabov
  • OFFLINE
  • Administrator
  • Denis Ryabov, Lead Developer
  • Posts: 4867
  • Karma: 105
Not that UserAgentSwitcher in Chrome affects javascript only, so actual http headers are the same.

Seeking advice re basic switching templates 14 years, 1 month ago #2310

  • dishyzee
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
  • Karma: 0
Thanks for your explanation, the user-agent switcher sounds like the easiest route. Incidentally I found this list of user-agents www.zytrax.com/tech/web/mobile_ids.html and wondered if there a mapping between something like this and the four templates provided by MobileJoomla.

DishyZee

Seeking advice re basic switching templates 14 years, 1 month ago #2314

  • Barnabas
  • OFFLINE
  • Moderator
  • Posts: 329
  • Karma: 6
Yes, there is a mapping. The zytrax site that you found collects mobile phone browser http strings. When I was testing different models of Blackberry Bold I cut and pasted the strings into the user agent switcher in firefox using the Edit User Agents Option. This was picked up by MJ and used to choose from the four templates.

Have a look at the following websites which illustrate what is happening in MJ.
wurfl.sourceforge.net/help_doc.php describes the WURFL project which takes that collection of mobile phone browser http strings and adds to it information about the capability of the browser together with details of the phone such as screen size and puts it all in a database.

www.tera-wurfl.com/explore/ shows how that database is implemented in MySQL and if you cut and paste a user string from the zytrax site into the field called
Enter a user agent below to view its capabilities:
You will see what happens in MJ because the tera-wurfl database is part of MJ and that is what is used to choose a template.

BUT please remember that user agent switcher techniques are not meant to replace testing with real phone browsers. They are useful to get an idea of what the site looks like, but phones can differ between models from the same manufacturer, for example how they show tables of information.
  • Page:
  • 1
  • 2
Time to create page: 0.13 seconds

By continuing to use this site you consent to the use of cookies on your device as described in our cookie policy unless you have disabled them. This site will not function correctly without cookies.

I accept cookies from this site.