You are here

jquery_ajax_load_node.module in jQuery AJAX Load 7

Module file.

Creates a manipulation of node entities. Could be applied to any entity and develop more complex functions.

File

modules/jquery_ajax_load_node/jquery_ajax_load_node.module
View source
<?php

/**
* @file
* Module file.
*
* Creates a manipulation of node entities.
* Could be applied to any entity and develop more complex functions.
*/

/**
* Implements hook_entity_info_alter().
*
* Adds the view mode to nodes
*/
function jquery_ajax_load_node_entity_info_alter(&$entity_info) {
  $entity_info['node']['view modes']['jquery_ajax_load'] = array(
    'label' => t('jQuery AJAX Load'),
    'custom settings' => TRUE,
  );
}

/**
 *
 * Returns a node on jQuery AJAX load view mode.
 * This function is highly customizable
 * For other entity type use jquery_ajax_load_view_ENTITY($id)
 */
function jquery_ajax_load_view_node($nid) {
  $node = node_load($nid);
  return node_view($node, 'jquery_ajax_load');
}

Functions

Namesort descending Description
jquery_ajax_load_node_entity_info_alter Implements hook_entity_info_alter().
jquery_ajax_load_view_node Returns a node on jQuery AJAX load view mode. This function is highly customizable For other entity type use jquery_ajax_load_view_ENTITY($id)