It was a bit of puzzle how to properly enable Twig debug in Drupal 8 and set up template refresh on every load. I had to go thought quite a few tips to figure it out on #SprintWeekend instead of making patches. There are a few guides but all were yet missing a step.

Oh well, long live good old “Rebuild the theme registry on every page load” in devel module for Drupal 7. I hope that will be solved in easier way for Drupal 8 too soon.

Don’t forget, in Drupal 8 templates are also cached at file system level, not just in database as it was in Drupal 7 (or previous).

So,...

30 Jan 2016 Comments (2) [totalcount] Read More

With latest project I had loads of solutions on contacting the original author of a Drupal node. But with client demand the simplest would win: here you go, a tiny Drupal 7 snippet for node template to facilitate contact for a node author (if you have contact module enabled). It also features an access permission check so only registered users could access that link.

You would need to put in your node--YOUR-CONTENT-TYPE-NAME.tpl.php of course. And to remove Bootstrap 3 style you can delete array('attributes' => array('class' => 'btn btn-warning')) part of course...

25 Nov 2014 Comments (0) [totalcount] Read More

With all this nifty fashion for icon fonts you probably want to add some icon to your label in Drupal webform module. The only issue is that by default webform would strip majority of HTML tags for security reasons. But it is quite simple to override those restrictions.

As you can see, by default it would only allow 'a', 'em', 'strong', 'code', 'img' (http://drupalcontrib.org/api/drupal/contributions!webform!webform.module...). To override just add a...

24 Jan 2014 Comments (0) [totalcount] Read More

Working on current Drupal 7 project we had to create customized facebook login button to fit nicely with the rest of oversized login option links. The target was to create completely custom CSS-able login buttons. It took a couple of hours to fix the puzzle into working condition.

This solution tested with facebook connect (https://drupal.org/project/fbcon...) 7x-2.0-beta4 module. Setting up fbconnect is out of scope of this article, but just to mention all settings are pretty much default. It will take care of fb initialization on...

20 Aug 2013 Comments (0) [totalcount] Read More

Sometimes it happens your Drupal 7 administration menu gets scrambled. This may be caused by some nasty modules, or like in my case it was inherited from MySQL crash in Drupal 6 version of a site.

Of course you can use Devel module which has a menu rebuild link in its block. But if you don't have Devel module installed, don't worry, it is easy and safe enough to fix menu manually in Drupal 7:

  • Delete you current links via SQL DELETE FROM menu_links WHERE menu_name='management'.
  • Clear all caches at...
10 Feb 2013 Comments (2) [totalcount] Read More