Hi
i want to switch theme for mobile OS`s but wonder how can i place link back to desktop theme on mobile theme (if user want to see site with desktop theme from mobile device)

Comments

novakov’s picture

Title: Link back to the deskop or mobile site » Link back to the deskop theme from mobile theme
mkalkbrenner’s picture

If you switch to the mobile theme by detecting the client's OS you're not using page caching, right?

In this case I suggest to add a link to your mobile pages that triggers a callback that set's a session value like $_SESSION['desktop_theme'] = 1;. This requires a little bit of coding. See hook_menu() for details.

Than your rule chain has to check for this session value:

system:session = desktop_theme=1 >>> desktop_theme
system:user_os_simplified = iPhone >>> mobile_theme

BTW the only way using page caching with mobile themes is to use dedicated (sub) domains like mobile.example.com and www.example.com. In this case it's easy to switch the theme according to the domain using system:host.

novakov’s picture

Status: Active » Closed (fixed)

thanks a lot for the answer. think that dedicated domains is better choise because i`ll need page cashing