Drupal 8: How to include the node id and a class in body based on the , depending on the current path

· konordo
While working on a custom bootstrap subtheme in Drupal, I needed to include specific classes in the body tag. There are two different cases that I needed to take into consideration, one for nodes and one for custom paths generated by e.g. from Views or Taxonomy. In the first case, I needed the node id to be included as a class, and on the second I needed a class name that was based on the path. To achieve this, I needed to edit two different files under my subtheme category. You will need to replace themename with the actual name of your theme.

Drupal 7: Views pager not showing!

· konordo
A weird issues came up after upgrading from Views version 7.x-3.7 to 7.x-3.8. The pager was missing from all views. After making sure that there are enough results to bring up a pager, and that the pager ID was unique for each view that shows up in the same page, we noticed the one thing that all views had in common: They all used Global: PHP fields. It seems that this is a known issue and that there is a patch that people confirm it works.

Drupal 7: Heartbeat comment messages show up twice!

· konordo
Heartbeat messages were showing up nicely on a project we have been working on lately, bringing up all the member activities including changing the user account details, adding or editing nodes and commenting on nodes. Everything was working fine right out of the box - except one minor inconvenience that we noticed: all comments were showing up twice in the heartbeat stream. As many love to say, this is not a bug, it is a feature.

Configuring drupal cron jobs in crontab.

· Anonymous (not verified)

Drupal 7 has the ability to run cron automatically, but if there are tasks that really depend on cron, it only makes sense to ensure that cron is running in pre-defined time spans.

To make sure of that, we can configure the drupal cron to run from a server side command. So from the console, In crontab, the following line will trigger Drupal's cron

Drupal Commerce - Translate Order total, Shipping Information, Billing information

· konordo

If you do not want to use i18n_string and i18n_field in order to translate the Order total, Shipping & Billing Information texts, that show up in the cart and on the checkout pages when using Drupal Commerce, the following hacky approach should do the trick.

First, the following funcion can be used in your template.php file: