Skip to content

Instantly share code, notes, and snippets.

@sillygwailo
Created February 13, 2014 22:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sillygwailo/8984914 to your computer and use it in GitHub Desktop.
Save sillygwailo/8984914 to your computer and use it in GitHub Desktop.
Mobify Your Drupal SIte

Mobify Your Drupal Site

Integrating Mobify is not as simple as adding a module. There's no getting around it: you have to hack your theme. Here are the instructions on Mobifying your Drupal site.

  1. Login or sign up for https://cloud.mobify.com/login/
  2. Mobify your site. https://support.mobify.com/customer/portal/articles/747219-getting-started-with-mobify-studio has good instructions on that.
  3. Publish your Mobified site.
  4. On your project page, copy the Mobify Tag
  5. In your theme's code, paste the tag just after the tag. In Drupal 6 or earlier, do this in page.tpl.php. In Drupal 7, do this in html.tpl.php.
  6. Clear your site's cache.

Bonus: Integrating Disqus Comments

Mobify strips all JavaScript from your site and puts in its own. To integrate Disqus comments, you'll need to add back jQuery, drupal.js and the Disqus module's disqus.js. Mobify has some generic Disqus instructions at https://support.mobify.com/customer/portal/questions/436847-disqus-comments-implementation but these instructions assume that the Disqus ID for nodes is 'node/[nid]'.

  1. Launch the Mobify Studio for your site.
  2. Assuming you have a separate template for the node pages, edit that Mobify template.
  3. Click the HTML tab.
  4. Next to HTML Includes, select "base".
  5. Just above {/headBlock}, paste in the following:
<script type="text/javascript" src="http://justagwailo.com/misc/drupal.js"></script> <script type="text/javascript" src="http://justagwailo.com/sites/all/modules/disqus/disqus.js"></script>`
  1. Near the bottom of your template, add <div id="disqus_thread"></div>
  2. Save your template.
  3. Click Finish.
  4. Publish your Mobify site.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment