Skip to main content

Articles tagged with "ctools"

Making the Flag Module's Confirmation form use AJAX

Chris Didcote
Chris Didcote
17th Apr 2012

This article discusses how we can use a combination of techniques to take the standard 'Confirmation Form' provided by the [Flag][flag] module and get it to load in a modal window rather than on its own page. We'll also extend this form slightly to allow the user to include some additional data before clicking 'Confirm'. As an example we'll use the Flag module to create an 'Abuse' flag that will apply to a comment entity - this is intended to allow a user to flag a comment as requiring moderations but before triggering the actions associated with the flag we...

Read more

CTools Path Access plugin

18th Mar 2011

I made a new Drupal 7 module today... the CTools Path Access plugin. It is a very simple module that provides a CTools access plugin for using the access rules of another path.

For example, you might set up a custom Panels search page in Page Manager, and just want to use the same access rules that the default Drupal search page uses at /search.

I have submitted the plugin as a patch for CTools itself, but until anything happens with that, it is available as a standalone project. I have only written the plugin with Page Manager...

Read more

Using CTools for form item dependency / visibility

James Silver
James Silver
10th Jan 2011

What are CTools Dependencies?

One of several helpers included in the ctools module, ctools dependency is described on the module page itself as "a simple form widget to make form items appear and disappear based upon the selections in another item". It's designed to make it easy and quick to hide/show form elements based on the value of other form elements in the browser using javascript.

This article was written in reference to Drupal 6. See below for notes about Drupal 7.

How to add visual dependencies to your form elements

An example. This code can live in the form...

Read more

Page manager redirect

1st Jul 2010

Quite often you need to redirect a particular path on a Drupal site, there are a number of ways to do this, but most involve writing PHP code. Also, it's not hugely easy to do things like redirect node/%node but only when %node is a 'image' node, posted on a Tuesday. The awesome Page manager module, and a little utility module we wrote changes that.

Page manager redirect Drupal module exposes a 'task handler' to Page manager. This means that we can do a 'task' when page manager matches a path, and other conditions pass; The task that Page manager...

Read more