Configure Postfix to Deliver All Mails Locally

On my computer a lot of local web development is going on, and every one of those sites have access to send mails. Sometimes these mails is configured to be sent to an external valid customer email account. The external customer may not be very happy about getting hundreds of testing emails, so in this post i will tell you how to configure postfix to deliver all mail sent to an internal account.

Use PhantomJS for Easy Website Screenshots

PhantomJS is a headless webkit browser, which means you can execute it from commandline and get it to do various tasks, such as headless website testing, screen capture, page automation and newwork monitoring.

In this blogpost i will show you how easy it is to take a screenshot of a website and save it to a preferred folder. I will use an Apple OSX computer for showing, but will easy be changed to ex. linux or Windows.

Install Apache Solr on Your Mac

I have made a lot of integrations against various Apache SOLR services, such as WebSOLR and Acquia Search. These services, does all the hard work for you, so you dont have to host the search index yourself.

When developing a website, and have to have a connection to those services, could be a pain in the… To let my work be more easy and straightforward, I have installed / configured a local Apache SOLR instance, for use for multiple cores.

F.lux App

F.lux makes the color of your computer’s display adapt to the time of day, warm at night and like sunlight during the day.

Getting Started With Vagrant

A Virtual Machine is a nice solution to handle different environments on you local machine. My computer is a Macbook Air, and, yes, i can install and use Apache, nginx, php, MySQL and so on, on that machine, and i often do. But if you want to make sure a project is with php5.2.7 on an Apache with a special version of MySQL, you don’t want to mess up you local environment.

Create a Ctools Access Plugin

After i saw that my name is a part of the long list of contributors to ctools 1.0 (i know it’s just a little patch, but everything counts), i think i have to give a little back.

I will try to explain how to create a custom “visibility rule” which in ctools is called an access plugin for use for ex. panels). The main reason for this, is that i have seen several times that the quick way to create a custom visibility rule in panels, is to choose the “PHP Code” rule, and enter som custom php code, and that’s in my opinion the worst way ever to handle access rules.

So in this guide i will show how easy it is to create your own custom access rule. Ex. you have an panel pane which only should be visible if a expression is TRUE, that could be if the node visited is of the type of ‘Page’, the authenticated user visiting the page have role ‘normal site user’ or a lot of other rules.

A case for me was to create an access rule, so a panel pane only is visible if a custom field on a node have a specified value.

In this example i need a node type with a field named ‘field_age_value’, and will be able to add a field to a panel pane, and create a visibility rule for this pane, so it’s only visible if the age on the node is 40.

Drupal 7 Formapi Number States a Hidden Diamond

Everyone who have worked as a developer on a Drupal website, sure does know the FormAPI but how many does actually know the #states property.

I will try to demo how to use that property. When #states is set on a field, some javascript is attached to the element, to allow it to have different active states.