Fork me on GitHub

To get this to work in a compiled mobile application (i.e. on your Android or iOS device), you must install the InAppBrowser plugin for your app.

Sometimes we want our Mobile Application to link to an external web page. PhoneGap has an InAppBrowser feature for this, so we can make external links in DrupalGap with these techniques:

Using the l() and bl() Functions

The l() function is shorthand for link. The bl() function is shorthand for button link.

Text Link

Text Link

var link = l('DrupalGap', '', { InAppBrowser:true });

Button Link

Button Link

var button_link = bl('DrupalGap', '', { InAppBrowser: true });

Using a Render Array

var content = {};
content['my_link'] = {
  theme: 'link',
  text: 'DrupalGap',
  path: '',
  options: {
return content;

You can use either link or button_link for the theme.

Plain HTML Link

<a onclick="'', '_blank', 'location=yes');">DrupalGap</a>

System Browser

It's possible to open links in the user's default browser using the _system target:

var html = bl('', null, {
    attributes: {
      onclick: "'', '_system', 'location=yes')"