Tag Archives: Drupal

Drupal 7 – Show page not found if view argument exists

Assume we have a Views page which does not have a contextual filter setting and the view path is /eureka. If you provide an argument in the url such as /eureka/abc, the argument is ignored and the Views page will return all view rows. But sometimes we may want to show the user a page not found instead of return all rows. This can be done by adding a Global: Null argument in the contextual filter.
Continue reading Drupal 7 – Show page not found if view argument exists

Drupal 7 – Render user profile picture programmatically @ 2

Yesterday we have talked about 2 normal ways to render the user profile picture in Drupal 7.
Drupal 7 – Render user profile picture programmatically @ 1

Unfortunately you can only get the user profile picture with default size if you have enabled the Gravatar integration moddule. i.e Continue reading Drupal 7 – Render user profile picture programmatically @ 2

BeansTag update

If you have no idea about BeansTag, please refer to BeansTag – The SEO tool for Drupal 7

Although BeansTag is not going to be approved as a Drupal 7 module, i still added some features to it as requested by the BeansTag users. But before i talk about the new features, i want to clarify a BeansTag concept

BeansTag depends directly on the url path.

For example, a node with nid = 1 has an url alias articles/abc, you can create 2 different BeansTags with the following paths.

  • node/1
  • articles/abc

Continue reading BeansTag update

Drupal 7 – Use queues for long running tasks in cron

Sometimes we may need to run some complex and time consuming tasks in Drupal cron but this may result in request timeout. It’s better to setup cron queues and run them in parallel requests.

Yesterday we have setup a hook_cron() task for batch updating nodes.
Drupal 7 – Batch update nodes by cron

Actually we can convert the tasks in the cron queues using hook_cron_queue_info() as follow.
Continue reading Drupal 7 – Use queues for long running tasks in cron

Drupal 7 – Add Javascript files on specific paths by template.php

In my previous post, Drupal 7 – Add Javascript files on specific paths by custom module, we try to add .js files for specific paths by creating a custom module. Actually we could implement the same feature by using the theme template.php. Here is an example.
Continue reading Drupal 7 – Add Javascript files on specific paths by template.php

Drupal 7 – Override the term path inside Tagadelic Tag Cloud

Implement tag cloud is easy in Drupal. You can find the module called Tagadelic in the my previous post.
Drupal 7 – Create a Tag Cloud with Tagadelic

But the term path inside the tag cloud is always fixed as default which is taxonomy/term/[tid]. I tried to override it by the Entity Path module but no luck. Luckily i find a workaround to override it. Actually Tagadelic is not just a simple Drupal module but also a API system. The following theme function theme_tagadelic_weighted() determines the term path in Tagadelic.
Continue reading Drupal 7 – Override the term path inside Tagadelic Tag Cloud