Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
While i m trying to replace the default node listing title by image grid, i m faced with empty list.
here is the following code.
/**
* The jQM pageshow callback for the node listing page.
*/
function node_page_pageshow() {
try {
// Grab some recent content and display it.
views_datasource_get_view_result(
'drupalgap/views_datasource/drupalgap_content', {
success: function(content) {
// Extract the nodes into items, then drop them in the list.
var items = [];
for (var index in content.nodes) {
if (!content.nodes.hasOwnProperty(index)) { continue; }
var object = content.nodes[index];
items.push(l(object.node.image, object.node.image, 'node/' + object.node.nid));
}
drupalgap_item_list_populate('#node_listing_items', items);
}
}
);
}
catch (error) { console.log('node_page_pageshow - ' + error); }
}
Can you please advise on how best can I display the images ?
Comments
Comment #2
tyler.frankenstein CreditAttribution: tyler.frankenstein commentedI really have to advise against the approach you are taking. It is ill advised to hack DrupalGap core. It would really be best for you to learn how to make a custom DrupalGap module, then learn how to use a Views Render Array to much more easily have control over your application: