Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 2 of 4
Automatic use of theme
 
leeschill
Jr. Member
 
Total Posts:  13
Joined:  2008-06-20
 

Nothing works for me.  Why is it so hard to have magento paste an explanation on how this works??????  I guess we should all pool our money together for a support ticket.  This is either a joke or there is no way to auto detect and send them to a different URL.  (and I know you can auto detect the iphone)

<!--
if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)))
{
location.href=’http://www.locationofyouriphonesitelayout.com/iphone/’;
}
-->

 
Magento Community Magento Community
Magento Community
Magento Community
 
zevious
Jr. Member
 
Total Posts:  23
Joined:  2008-07-17
 

I think this is a problem when your are using a non-default theme such as modern and trying to use the iphone theme.  The Designer Docs state that Magento can currently only load 2 themes…

 
Magento Community Magento Community
Magento Community
Magento Community
 
seudo
Guru
 
Avatar
Total Posts:  344
Joined:  2008-04-21
 

If you are using Firefox you can use this add-on to switch your user agents for testing reasons.

Switcher

The settings are as follows for iPhone:
Description: iPhone
User Agent: Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en)
App Name: AppleWebKit/420+ (KHTML, like Gecko)
App Version: Version/3.0
Platform: Mobile/1A542a Safari/419.3

Just copy and paste the non bold values into the options for Switcher.

Got this info from TestiPhone.com.

 
Magento Community Magento Community
Magento Community
Magento Community
 
seudo
Guru
 
Avatar
Total Posts:  344
Joined:  2008-04-21
 

Ok got this working in version 1.1.6 in a custom package doing the following:

package is defined as /magento/app/design/frontend/PACKAGE/themes where PACKAGE holds all the themes.

If you have a custom package you need to copy the iphone theme to that package:

/magento/app/design/frontend/PACKAGE/iphone AND /magento/skin/frontend/PACKAGE/iphone

Then go to

System > Configuration > Web (my bad had design here)

Then in Themes > Default add an exception like shown earlier in this topic:
Matched expression: iPhone|iPod
Value: iphone - this is the name of the iphone theme in the theme folder as shown above

If you don’t have the iphone theme in your package you can quickly test it by doing this:

Under Package > Current package name - add an Exception here:

Matched expression: iPhone|iPod
Value: default - which is this package ->(/magento/app/design/frontend/default)

Then in Themes > Default add an exception:
Matched expression: iPhone|iPod
Value: iphone - which is in the default package located here /magento/app/design/frontend/default/iphone

Hope this helps.

 
Magento Community Magento Community
Magento Community
Magento Community
 
zevious
Jr. Member
 
Total Posts:  23
Joined:  2008-07-17
 

I have this:

/app/design/frontend/default
under that folder is

default
modern
iphone

and the following under exceptions.  No dice.  Any idea what I have wrong?  TIA!

Image Attachments
Image2.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
 
seudo
Guru
 
Avatar
Total Posts:  344
Joined:  2008-04-21
 

@zevious - What version are you using?

If your package is already default you don’t need an exception there.

You can remove the exception in the Package section. Leave the exception in the themes section.

Do you have the switch add-on for firefox to test?

 
Magento Community Magento Community
Magento Community
Magento Community
 
setanta
Member
 
Total Posts:  33
Joined:  2007-11-01
 

Doesn’t seem to work for multistore domains?  I have it working on the root domain that I installed magento on, but its not working on add on stores/sites.

Very cool start though!

 
Magento Community Magento Community
Magento Community
Magento Community
 
zevious
Jr. Member
 
Total Posts:  23
Joined:  2008-07-17
 
seudo? - 30 September 2008 06:36 PM

@zevious - What version are you using?

If your package is already default you don’t need an exception there.

You can remove the exception in the Package section. Leave the exception in the themes section.

Do you have the switch add-on for firefox to test?

1.1.6

I’ve tried it with and without that exception. 

I have an iPhone to test with.

I still think it has to do with using the modern theme and the iphone theme.  The docs state that only one main theme and 1 extra theme can be used..  for now.

 
Magento Community Magento Community
Magento Community
Magento Community
 
gjr
Jr. Member
 
Total Posts:  20
Joined:  2008-08-11
Tilburg, The Netherlands
 

I have the latest version of the iphone theme, and the latest version of magento. 1,2,1,1

The default theme is installed, and a custom theme is installed.

Now i installed the iphone theme via magento connect. How to activate it?!?!
I really can;t get this done. Can somebody help me a hand.

 
Magento Community Magento Community
Magento Community
Magento Community
 
vholkano
Jr. Member
 
Avatar
Total Posts:  21
Joined:  2008-02-23
 

Hi, I need to use the Iphone theme for all the mobile devices, but I have no idea how to. Somebody knows How to?
Regards,

 
Magento Community Magento Community
Magento Community
Magento Community
 
seudo
Guru
 
Avatar
Total Posts:  344
Joined:  2008-04-21
 

@gjr and vhokano - You need to go to System -> Configuration -> Web
@gjr - check your folders under magento/app/design/frontend/default
There should be a directory in there called iphone. There should also be one in magento/skins/frontend/default

Expand Themes

under Default Add Exception

This would be for user agents to be directed to iphone theme.

Matched Expression: iPhone|iPod (add other user agents here separted by | )

Value: iphone

To test in a firefox browser see this post: http://www.magentocommerce.com/boards/viewthread/12310/P15/#t64915

 
Magento Community Magento Community
Magento Community
Magento Community
 
vholkano
Jr. Member
 
Avatar
Total Posts:  21
Joined:  2008-02-23
 

seudo? Thanks!!  How do I know the agents? For example for Nokia and Windows Mobile? Regards

 
Magento Community Magento Community
Magento Community
Magento Community
 
seudo
Guru
 
Avatar
Total Posts:  344
Joined:  2008-04-21
 

Here is a list of some User Agent strings.
Another way is to create a simple script.

<?php echo $_SERVER['HTTP_USER_AGENT']?>
Direct the device in question to it and you get the user agent.

Or try

<?php
echo $_SERVER['HTTP_USER_AGENT'"\n\n";

$browser get_browser(nulltrue);
print_r($browser);
?>
Which prints out the user agent string in an array form.

Either way I believe if it finds the matched expression value located in the user agent string it will direct to use the theme defined in the value field.
For example iPhone|iPod|Nokia|Windows CE should redirect to the iphone theme. I have not tested this but I think it will work.

 
Magento Community Magento Community
Magento Community
Magento Community
 
gjr
Jr. Member
 
Total Posts:  20
Joined:  2008-08-11
Tilburg, The Netherlands
 

Seudo, where do i find matched expression?

Is it in the magento backend or the file folders? 

At the moment i am using a custom default theeme in my 3 language store. I would like to use the iphone theme for iPhone|iPod|Nokia|Windows CE. The only way i get it done is to overide the default theme. Auto-select simply won’t work.

Main Website
Main Website Store
English blank/theme008
Main Website
Main Website Store
French blank/theme008
Main Website
Main Website Store
German blank/theme008

I have my magento translated into Dutch, so it might be hard to find. Any screenshots maybe?

 
Magento Community Magento Community
Magento Community
Magento Community
 
seudo
Guru
 
Avatar
Total Posts:  344
Joined:  2008-04-21
 

@gjr - this is how I have setup our redirect to the iphone theme and where the matched expressions are located.

Log into admin section via the browser, go to System > Configuration > Design.

Look at the screen shot.

In the design section under Themes there are a few listings:

Under default we have set the expressions. Simply click the add exception button and enter the info.

our folder structure looks like this for the iphone theme:

magento/app/design/frontend/simplebrick/iphone

as you can see the package is simplebrick

our standard theme that is accessed by everything else is called default - as this is where magento automatically pulls any template and layout files if they are not found in any other theme.

our folder structure for that looks like this:
magento/app/design/frontend/simplebrick/default

accordingly all the images and css stuff is located in the skins folder here for the default theme:
magento/skin/frontend/simplebrick/default

hope this clears things up.

Image Attachments
sys_config_design.gif
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 2 of 4