Magento Iphone Mobile theme Home page issue

Magento Iphone Mobile theme Home page issue

August 19, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento Iphone Mobile theme Home page issue

Resolving Magento Iphone Mobile Theme Home Page Issues

Hello developers,

Today, we’re going to tackle a common question that arises while setting up an iPhone theme for your Magento store. I’ll provide step-by-step guidance on how to ensure your categories page is displayed straight away when accessed via mobile devices.

Understanding the Current Setup

You’ve done a great job so far:

  1. You’ve set a CMS page as your default home page.
  2. You’ve uploaded the iPhone theme to the themes folder.
  3. Under System > Configuration > Design > Themes > Templates, you’ve correctly specified the matched expressions for mobile devices.

The issue lies in how Magento handles the default home page and the mobile-specific redirect.

The Problem: CMS Page Displayed on Mobile Devices

The current configuration is causing two primary issues:

  1. CMS Page Display: Even when accessed via a mobile device, the default CMS page (set as the home page) is displayed instead of the categories page. This happens because Magento doesn’t inherently distinguish between desktop and mobile views for the default home page.

  2. Layout Issues: The iPhone theme isn’t being applied correctly to the full width of your desktop layout. The wide banner image (960px) from your CMS page is causing the page content to scroll horizontally on mobile devices, which defeats the purpose of a responsive design.

The Solution: Redirecting Mobile Traffic to Categories Page

To solve this, we need to create a new CMS page for the iPhone theme that displays the categories and then redirect mobile traffic to this page. Here’s how:

Step 1: Create a New CMS Page for iPhone Theme

In your Magento admin panel:

  • Navigate to Content > Pages
  • Click on “Add New Page”
  • Set the title (e.g., “iPhone Home”)
  • In the Content tab, add the following code to display categories:
{{block type="catalog/navigation" name="catalog.category.topnav" as="topNav" template="catalog/navigation/top.phtml"}}

<div id="content">
    <div class="category-products">
        {{block type="catalog/product_list" category_id="2" template="catalog/product/list.phtml"}}
    </div>
</div>

Replace “2” with your desired category ID.

Step 2: Redirect Mobile Traffic to the New CMS Page

We’ll use an observer to intercept requests and redirect mobile traffic. Here’s a simple observer example:

class RedirectMobileToIphonePage implements ObserverInterface
{
    public function observe($observer)
    {
        $action = $observer->getControllerAction();
        $request = $observer->getEvent()->getRequest();

        if ($request->isAjax() || !$request->isXmlHttpRequest()) {
            return;
        }

        $agent = $request->getServer('HTTP_USER_AGENT');

        // Check for common mobile devices
        if (strpos($agent, 'iPhone') !== false || strpos($agent, 'Android') !== false) {
            $action->setRedirect( Mage::getUrl('cms/page/view', array('page_id' => 2)));
            Mage::app()->getResponse()->sendBody();
            exit;
        }
    }
}

This observer checks if the request is mobile (iPhone or Android), and if so, redirects it to the new CMS page with ID 2.

Implementing the Solution

  1. Create a new module in your Magento store.
  2. Paste the observer code into an appropriate file (e.g., app/code/local/YourCompany/MobileRedirect/etc/config.xml).
  3. Set up the observer configuration:
<config>
    <global>
        <events>
            <controller_action_predispatch>
                <observers>
                    <your_company_mobileredirect_redirectmobiletopage>
                        <type>singleton</type>
                        <class>YourCompany_MobileRedirect_Model_Observer</class>
                        <method>observe</method>
                    </your_company_mobileredirect_redirectmobiletopage>
                </observers>
            </controller_action_predispatch>
        </events>
    </global>
</config>

Replace “YourCompany” with your actual company name.

Conclusion

By following these steps, you should be able to resolve the iPhone theme home page issues in your Magento store. The key is to create a mobile-specific CMS page and use an observer to intercept requests and redirect mobile traffic to this new page.

Remember, always test your changes thoroughly on various devices to ensure they work as expected. If you need further assistance or want to explore more advanced customizations for your Magento store, feel free to reach out to our team at LaravelCompany.

Happy coding!

Catalog Themes Configuration Errors

Our network