Mobile tools module allows to configure separate theme for mobile devices. I am wondering if there a way I can define a ND build mode for mobile devices, and not include the fields and unsupported formats on the devices.

Comments

swentel’s picture

Title: Build mode for mobile tools/themes » Build mode for mobile tools/themes - support for CCK and Display Suite
Project: Node displays » Mobile Tools
Version: 6.x-2.3 » 6.x-1.x-dev

Well you can create a build mode via the interface of course. But we'll have to work together to get this working. We're lucky on this part that mobile tools comes before node displays during hook implementations. So what should happen is this:

function mobile_tools_content_build_modes() {
  return array(
    'mobile_tools' => array(
      'title' => t('RSS'),
      'build modes' => array(
        'mobile_tools' => array(
          'title' => t('Mobile theme'),
          'views style' => TRUE,
        ),
      ),
    ),
  );
}

function mobile_tools_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  if ($op == 'load' && $_SESSION['mobile-tools-site-type'] == 'mobile') {
    $node->build_mode = 'mobile_tools';
  }
}

Moving this to the issue queue of MB where this code should live - this can go in as patch and should work immediately.

g.k’s picture

Thanks swentel, I am looking forward for nd mobile build mode implementation. Meanwhile, I can implement the hook through a custom module...

twom’s picture

Assigned: Unassigned » twom
Status: Active » Needs work

Hi Swentel,

Thanks for this contribution. I'll add this to Mobile Tools.

twom’s picture

I added this to the dev version.

Possible extensions are the use of device groups in order to create build_modes based on devce types

twom’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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

dpalmer’s picture

Swentel, coming through with awesome contributions again.

Thank you so much for all the work you have put into DS, I use it on every single site and have gotten all the developers i know to start using it as well. :)