Step 1 : Since we'll be using php codes in a block to display menu, the first thing to do is to enable the PHP Filter under modules.

Step 2 : Go to administer->block->add block and create a new block. Add a description (i use submenu). Choose PHP Code as the filter and paste the code below in the body textarea.

Step 1 : Enable the trigger module if you haven't done so. (To enable the trigger module, go to administer->site building->module. check the trigger module and press save.)

Step 2 : Go the administration panel and click on action. Under Make a new advanced action available, select Redirect to URL... and hit create.

Enter a description and the url to redirect to. You can use internal url like node/123 to redirect the user on login.

Press Save.

Drupal API Search for Firefox

By: Arshad

7 Jan 2010

Update : This works in google chrome too. Press CTRL+B to show your bookmark toolbar. then follow the steps below.

Step 1 : Right-click on the bookmark tab and create a new bookmark.

Step 2 : In the new pop up window enter "Drupal Search" as name and the javascript code below in location.

Code

A quick way to search for tweets from your browser.

Download the extension here.

A Google Chrome extension that make searching drupal.org and the drupal API quick and easy.

Download the extension here .

By default, any text entered in the search box is searched on drupal.org website.

Searching the Drupal API

Use 6:keyword or 7:keyword to search for the respective api version.

Actually there are many ways this can be achieved. There are some efficient ways and some quick ones. Below is one quick and simple way of checking if a string has html tags or not.

  1. /**
  2. * This function will return true is the string contains html tags and false otherwise
  3. */
  4. function hasHtml($str){
  5. //we compare the length of the string with html tags and without html tags
  6. if(strlen($str) != strlen(strip_tags($str)))
  7. return true;
  8. return false;
  9. }

Code to select the content of an input box on click

  1. //set select when clicking on an input
  2. $('input[type=text]').click(function(){
  3. $(this).select();
  4. });

sometimes you want it to occur on focus. replace click(function(){.. by focus(function()...

Selectlink

By: Arshad

31 Dec 2009

Select Link is a jquery plugin that provides a pop up when words on your website are selected.

The plugin can be found here.

This plugin can be used in many ways. Some examples :

About Me

Arshad Chummun Hello I'm Arshad. I'm a 21 years old Drupal Web Developer. This is a site i put up for some reasons i can't remember and this is where i write stuffs i need to remember.;)

In the Web world, i head the Drupal Mauritius User Group and the jQuery user Group Mauritius and i'm a campus representative for Mozilla Firefox. 

DrupalCon CPH 2010

Copenhagen August 23 -27

Drupalcon CPH 2010