Friday, 28 January 2011

Adding Custom Links to Drupal Views

http://www.enterana.com/blog/web-development/adding-custom-links-drupal-views
For a project that I am working on, I needed to add function links to various Views that I was creating. I wanted to add links to actions that I had written in the site's custom module. Initially, I had some trouble figuring out how to do this but once I found the right kind of field to add it's a piece of cake.
The magic lies in the "Global: Custom Text" field type, and the only real trick is that you need to add your included fields first. Here's how to do it:
  1. Create or open a View
  2. Add your desired Fields
  3. For my action, I wanted to reference the Node's id (nid). However, I had no reason to display the nid to the user. So, I added the nid Field but selected the "Exclude from Display" option.

No comments:

Post a Comment

Source base installation of php, mysql and apache in ubuntu/ linux

Compile and Install a LAMP(Linux/Apache/MySQL/PHP) Server from Source In the last post, I described the method to install a LAMP ser...