2

Is it necessary to write all the mobile app's own html files for displaying Drupal configured Blocks / Pages / Views? I was hoping I could just rebuild my primary Navigation menus using the DrupalGap settings.php files or hook_menu, but leave the callbacks to just inject the return HTML?

For example...

drupalgap.settings.menus['user_menu_standard'] = {
    links:[
    {
        title: 'A Title',
        path: '/some-content-type',
        options: {
            attributes: {
                'data-theme': 'b'
            }
        }
    },
};


function my_module_menu() {
  var items = {};
  items['airlines'] = {
    title: 'airlines',
    page_callback: 'my_module_airlines_page'
  }  
  return items;
}

// No mobile dedicated html file necessary. I essentially want a webview with a phonegap native menu.
function my_module_airlines_page(html) {
  div.innerHTML = html;
}

Is this - or something similar - possible to automatically reuse the Drupal's front-end within DrupalGap?

1

DrupalGap is typically used to consume Views as JSON results. It can then use the JSON to decide how to display the HTML inside the app.

Check out this example for creating a page in your App that will fetch and display Views content:

http://www.drupalgap.org/node/219

Out of the box, it easily lets you create lists and tables of your Views data.

  • 1
    thanks much @tyler.frankenstein . so it sounds like 'no' is this answer. or yes, i do have to write all JSON parsing and View files / html templates fresh. Thanks, while at it i will definitely play around with extending your drupalgap_item_list_populate method against block templates. – E.A.T May 29 '14 at 11:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.