Comments

Anonymous’s picture

Assigned: » Unassigned
Issue summary: View changes

Hi,

I am trying to add an edit link while showing the content of a node. Here is the code that I am using

function mymodule_menu(){

$items = array();

$items['view/content_information/%/%ctools_js'] = array(
    'title' => t(''),
    'page callback' => 'content_details_ajax_callback',
    'page arguments' => array(2),
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
  );

return $items;
}

function content_details_ajax_callback($ajax){
global $base_url;
if ($ajax) {
	ctools_include('ajax');
	ctools_include('modal');
	
		$nid = arg(2);
		$node = node_load($nid);
		$contents = render(node_view($node, 'teaser', NULL));
		//$edit_link = $base_url."/node/".$nid."/edit";
		//$link = l("Edit", $edit_link);
  return ctools_modal_render($node->title, $contents);
	
}
}

I have marked comment the link which I want to add with the node content but I am not getting, how to send the link so that, it will appear in modal window under the node content. Please Advice.
Thanks in Advance.