Blogz

Recent Blogz

Drupal 7: CTools adding CSS to Modal window with example[ctools_add_css()]

In Drupal core the function drupal_add_css() help us to achieve adding CSS for a specific pages. The CTools modal popup will not support core drupal_add_css() functions. We have to use CTools functions for adding CSS files to modal window. The function ctools_add_css() will help to adding CSS files into modal popup windows. The function accepts filename, Module name and path for adding the CSS file.

Drupal 7: CTools adding JS to Modal window with example[ctools_add_js()]

In Drupal core the function drupal_add_js() help us to achieve adding JS for a specific pages. The CTools modal popup will not support core drupal_add_js() functions. We have to use CTools functions for adding JS files to modal window. The function ctools_add_js() will help to adding JS files into modal popup windows. The function accepts filename, Module name and path for adding the JS file.

Drupal 7: CTools Image button with Example [ctools_modal_image_button()]

The CTools not supporting normal l() function of Drupal, we need to use its own function for creating links and buttons. The below example will demonstrate about creating Image link button with an example. The function ctools_modal_image_button() used for creating image button by CTools.

Drupal 7: Programatically Creating CTools Buttons [ctools_ajax_text_button()]

The CTools plugin will not open with normal buttons and links. To open a page or form via CTools we need to use ctools buttons(ctools_ajax_text_button()). This ctools_ajax_text_button will create a link that contains the base class that help to pop up the pages.

Drupal 7: Adding Drupal set messages using PHP(drupal_set_message()) and Javascript:

In Drupal messages are printed using the PHP function drupal_set_messages(). This article will discuss the adding message to page through the PHP as well as Javascript. The normally the set message will create a div HTML wrapper for display the messages. Using the classes of the set message we can display the Error/Status/Warning message to the end users.