You are here

function ajax_links_api_help in Ajaxify Drupal with JQuery Ajax 6

Same name and namespace in other branches
  1. 8 ajax_links_api.module \ajax_links_api_help()
  2. 7 ajax_links_api.module \ajax_links_api_help()

Implements hook_help().

File

./ajax_links_api.module, line 138
Make any links or create new links to load content to particular DIV via jQuery Ajax.

Code

function ajax_links_api_help($path, $arg) {
  if ($path == 'admin/settings/ajax-links-api' || $path == 'admin/help#ajax_links_api') {
    $output = t('<h2><strong>Before start</strong></h2>
        <p>In your theme page.tpl.php , <code>@content</code> should be surrounded by a div with a class
(or id).If no div ,add the div yourself.</p>
        <p>Example : <code>@target</code></p>
        <p>In this case, just enter #content as Default Target DIV in module config page</p>
        <h2><strong>How to use Ajax links API</strong></h2>
	
	<p><strong>Method 1</strong> : You can ajaxify any links by specifying the Class/Id in <a href="@admin">Module settings page</a>.
	Target DIV will be default Target DIV defined in module config page.</p>
	<p>Example : <code>@example1</code> . You can ajaxify this link by adding
	<code>.test</code> in module config page.</p>
	
	<p><strong>Method 2</strong> : Use this in your tpl => <code>echo l_ajax($title, $path, $target)</code></p>
	<p>* <code>$title</code>: Title to display.<br />
	* <code>$path</code> : Drupal path. <br />
	* <code>$target (optional)</code>: ID or CLASS of DIV to be replaced. You can override default Target DIV defined by specifying <code>$target</code>.</p>
	<p>Example : <code>l_ajax("Add Page","node/add/page","#content")</code>.</p>
	
	<p><strong>Method 3</strong> : Add <code>class="ajax-link"</code> to any link. Target div will be Target DIV defined . You can change default Target DIV or override target by specifying <code>rel=""</code>.</p>
	<p>Example : <code>@example2</code></p>
	
	<h2><a href="@demo">DEMO</a></h2>', array(
      '@content' => '$content',
      '@target' => '<div class="#content"><?php print $content; ?></div>',
      '@admin' => url('admin/settings/ajax-links-api'),
      '@example1' => '<a class="test" href="node/add/page">Add page</a>',
      '@example2' => '<a class="ajax-link" href="node/add/page" rel="#content">Add page</a>',
      '@demo' => url('ajax-links-api/test'),
    ));
  }
  return isset($output) ? $output : NULL;
}