Quantcast
Channel: Drupal – Niluka's Blog
Browsing all 25 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Cron crawler in 7.x

I’m new to Drupal and have just developed a small site on Drupal 7. I am seeing very sluggish response times from my shared hosting provider, so I started playing around with cacheing options. Boost is...

View Article



Image may be NSFW.
Clik here to view.

Drupal 7 boost clear all cache

In Drupal 7 when clicking clear cache button, all boost cache also clean. Find the boost_flush_caches() in boost.module and comment if (isset($_boost['base_dir']) &&...

View Article

Image may be NSFW.
Clik here to view.

Drupal 7 Override tag page.

Need to theme Taxonomy pages on a client site and am finding out that D7  rendering of taxonomy term pages. Page menu alter function function hook_menu_alter(&$items) { if...

View Article

Image may be NSFW.
Clik here to view.

Drupal 6: Set Default Value in CCK Select List Widget Using PHP

When a select list widget is created in a field using CCK in Drupal 6, it is possible to manually set a default value as one of the form fields (see below). However, it may not always be preferable to...

View Article

Image may be NSFW.
Clik here to view.

Remove certain meta tags in Drupal 7

In some cases you might won’t need any meta tags and canonical urls on your site. In this tutorial I will show how to remove it from the code by using preprocess function. <linkrel="shortlink"href="...

View Article


Image may be NSFW.
Clik here to view.

Drupal 6 function theme_pager

If you want a pager in the style of the Expedia sites were ‘first’&’last’ links are hidden and the ellipsis are attached to the prev/next page numbers like so: Showing Results 11 – 15 of 17 Prev …3...

View Article

Image may be NSFW.
Clik here to view.

Drupal 7 Function to clear Boost’s cache

boost_expire_flush_boost_cache is a pretty stupid function, but that’s because there are no easy ways to expire certain parts of the Boost cache, while Boost is still in development for Drupal 7. But...

View Article

Image may be NSFW.
Clik here to view.

Drupal 6 Change search result view

If you need to create a custom Search View then the Search API module is all you need to rely on. It is quite easy to create Module on search data using Search AP Implementation of hook_menu_alter()....

View Article


Image may be NSFW.
Clik here to view.

Drupal 7.20 Image Styles return a url with Access Denied

The security fixes in this release change all image derivative URLs generated by Drupal to append a token as a query string. (“Image derivatives” are copies of images which the Drupal Image module...

View Article


Image may be NSFW.
Clik here to view.

Drupal 7 – How to load a template from a module?

hook_theme($existing, $type, $theme, $path) /*hook_menu*/ function myModule_menu() { $items['ajaxcardc/%'] = array( 'title' => '', 'page callback' => 'ajaxcard_ccompare', 'access arguments'...

View Article

Image may be NSFW.
Clik here to view.

drupal 7 how to add fields to publish option

/** * Implements hook_form_alter(). */ /*implement hook_form_alter*/ function example_form_alter(&$form, &$form_state, $form_id) { if($form_id =='example_form_id'){...

View Article

Image may be NSFW.
Clik here to view.

Cron run exceeded the time limit and was aborted.

When run cron manually by visiting mysite.com/cron.php can see blank page Check the logs, and id get the following message: Cron run exceeded the time limit and was aborted. There may be some issue in...

View Article

Image may be NSFW.
Clik here to view.

Working With Table And Pagination In Drupal 7

When developing a module for Drupal 7 you can display the query result into a table and then display it along with the pagination. Look at the code below to see how to create a table with pagination in...

View Article


Image may be NSFW.
Clik here to view.

Drupal 7 How to get default language

language_default() Returns the default language used on the site $defaultLanguage=language_default(); $defaultLanguage=$defaultLanguage->language;

View Article

Image may be NSFW.
Clik here to view.

How to add a Cancel Button to Drupal 7 forms

Cancel button to take them back to the previous page. function hook_form_alter(&$form, &$form_state, $form_id) { $form = array(); $form['actions']['cancel'] = array( '#type' => 'submit',...

View Article


Image may be NSFW.
Clik here to view.

Drupal 7 custom pagination

function pager_default_initialize pager_default_initialize($total, $limit, $element = 0) “If the items being displayed result from a database query performed using Drupal’s database API, and if you...

View Article

Image may be NSFW.
Clik here to view.

Drupal 7 Performance – Minify HTML output

To minify HTML output in Drupal 7, you can remove line breaks. This can be done in your template file html.tpl.php. Replace print $page; To $output = str_replace(array("\r\n", "\r"), "\n", $page);...

View Article


Image may be NSFW.
Clik here to view.

Drupal 7 views, get view row count

Display the total number of rows shown in a Drupal view using views_get_view function . Using views_get_view function, views_get_view($name, $reset = FALSE) Parameters $name : The name of the view....

View Article

Image may be NSFW.
Clik here to view.

How can we set the items per page to a view, programatically?

How can we set the items per page to a view, programatically? This is also a way to embed views programatically into your pages and nodes. The following lines of code will load a view and print the...

View Article

Image may be NSFW.
Clik here to view.

Ckeditor file browser disabled for security reasons. I’m using ckfinder....

Ckeditor says file browser disabled for security reasons. Can’t upload anything how do it fix this? Removed the $cookie comment from settings.php and followed all the drupal.ckeditor.com installation...

View Article
Browsing all 25 articles
Browse latest View live




Latest Images