Posts

JS ordering in Drupal

Adding .js in info files adds that js file to every page of the website. Scripts added in a theme's .info file are added at the theme level of ordering and will come after core/library JavaScript and module JavaScript. Ordring: core modules => contributed modules => theme  Altering the scope of the JS file function YOURTHEME_js_alter(&$javascript) { $header_scripts = array( 'sites/all/libraries/modernizr/modernizr.min.js', 'misc/drupal.js', 'sites/all/modules/jquery_update/replace/jquery/1.5/jquery.min.js', ); foreach ($javascript as $key => &$script) { if ($script['scope'] == 'header' && !in_array($script['data'], $header_scripts)) { $script['scope'] = 'footer'; } } }

Running simpletest from command line

php scripts/run-tests.sh --php /Applications/MAMP/bin/php/php5.6.10/bin/php --list => lists all test cases php ./scripts/run-tests.sh --php /Applications/MAMP/bin/php/php5.3.29/bin/php --all => runs all test cases php ./scripts/run-tests.sh --php /Applications/MAMP/bin/php/php5.3.29/bin/php Webform => it runs all the test cases in webform module

To know about the core Drupal architecture

http://www.drupaldeconstructed.com/content/01-request.html , https://www.gitbook.com/book/mcrittenden/drupal-7-deconstructed/details is a very nice book written to understand Drupal7 and Drupal8 core. 

Continuous Integration with Bamboo - reference

Plan => Build => Deployment Plan    Associate a repository, Write a trigger  SVN: Dev server: Points to 'develop' branch As soon as developer commit the code in 'develop' branch it is automatically deployed in Dev server. svn switch . (or) svn up svn up -> has to be run by a cron in few seconds interval svn switch ? <TODO> Test server: Points to a <tag> A <branch> is created from Dev branch at certain point when the stories are ready for testing. A <tag> is created from <branch> and deployed in Test server svn switch <tag> Testing happens in Test server When bugs are found, they are fixed in <branch>.  <tag+1> is created from <branch> when it is ready for deployment in Test server The cycle continues from steps 3 to 7 UAT server: Points to a <tag> When a QA certified <tag> is available from Test server it is deployed in UAT svn switch <tag...

Display Suite Situations in Drupal

1. Scenerio: The title needs to be printed on image field as overlay. The title field is printed in page.tpl.php and you dont get $title variable in node.tpl.php Solution: In display suite create a code field and put the [node|title] token in that field. In the manage display of fields place the code field wherever you want. 2. Scenerio: There is a Content Type and there is a field xx and field yy. xx is a textarea field and yy is a date/time field. Based on value on yy some different text has to be printed on yy field. Solution: In display suite create a code field and put the [custom|xx] token in that field. In the manage display of fields place the code field wherever you want. Write the logic in token creation code.

Browser plugins to select any element on the page

These plugins will highlight the elements on the page and provide the selector for that. This is very useful where we don't need to refer the JQUERY documentation. This will speed up the development. Jquery unique selector Selector assistant Selector gadget

How to get internet connected to my CentOS in VM

dhclient -v