Drupal 7: CTools close button with example

The CTools will not support l() function of Drupal core. It will support its own Links. The function ctools_ajax_text_button() we can create links. The below example will demonstrate about creating a close button for the current modal window.

Example 1:

$cancelLink = ctools_ajax_text_button('Close', '', 'Close the Window', '', 'ctools-close-modal'); // Modal popup Close link.

Example 2:

$cancelLink = l('Cancel', '/' , array('attributes' => array('class' => 'ctools-close-modal')));

Similar Post:
Drupal 7: Programatically Creating CTools Buttons [ctools_ajax_text_button()]
Drupal 7: CTools close button with example
Drupal 7: CTools Image button with Example [ctools_modal_image_button()]

Category: