The Mobile Tools block message is used to manually switch between desktop and mobile sites.

If the user is visiting a page when the click the link, they will be brought to the homepage of the alternate version

The link should be generated dynamically to show the same page the user is already visiting, with the alternate theme.

Comments

tallsimon’s picture

I agree this is a much needed feature. Perhaps token integration would be the best way to go, so you could choose what to add in the link, whether it be a link to a specific url or a link to [base][alias] (example, not actual tokens!)

guruslot’s picture

Version: 6.x-1.12 » 6.x-2.2

Does someone could explain how to user a token !desktop_url?
I'm stuck tried different combination and it does not replaced by url. Token module is enabled.

Thanks in advance!

fprevos2’s picture

I create myself a block module to make a html link. It pretty much base on the mobile_tools_block hook.

Here the code:

$site = mobile_tools_site_type();
  if ($site == 'mobile') {
    $output = '<a href="';
    $query = $_GET;
    $query = drupal_query_string_encode($query, array('q'));
    $url = url($_GET['q'], array('query' => $query));
    $desktop_url = variable_get('mobile_tools_desktop_url', '') . $url;
    $output .= $desktop_url. '" >'. t('Full site'). '</a>';
    return $output;
  } 
  elseif($site == 'desktop') {
    $output = '<a href="';
    $query = $_GET;
    $query = drupal_query_string_encode($query, array('q'));
    $url = url($_GET['q'], array('query' => $query));
    $mobile_url = variable_get('mobile_tools_mobile_url', '') . $url;
    $output .= $mobile_url. '" >'. t('Mobile site'). '</a>';
    return $output;
  }
xen’s picture

Issue summary: View changes
Status: Active » Fixed

I believe this was imlemented in 2.3, and further changed later.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.