Blogs

The Angular CLI

One of the tools that I use frequently when building Angular v2+ applications is the amazing Angular CLI toolkit. The Angular CLI is a command line tool that allows for quickly bootstraping Angular applications that serve locally right out of the box. The created application is built to serve on Webpack and requires Node v4+ and NPM v3+. Installing the Angular CLI with NPM is very easy using the below command.

Programmatically Save Field Collection in Drupal

Below you will find a quick snippet example of how to save a field collection programmatically in Drupal 7.

/**
 * Save New Field Collection
 */
$field_collection = array(); // new array
$field_collection['field_name'] = 'field_collection_field_name'; // field collection machine name
$field_entity = entity_create('field_collection_item', $field_collection); // create entity in system

5 Column Layout with Bootstrap

Recently Shamley Incorporated received a client request for a new feature that required a 5 column layout. We have been using Bootstrap 3.x for this site which makes most layouts very easy, however there is no way to make it work for 5 even columns. Luckily it is pretty simple to add your own Bootstrap layouts, the below code pattern will give you a nice feature set for building your 5 column layout with the options shown in the image.

File Downloads with the HTML5 Download Attribute

So...I was wrong. I had thought that file downloads like below were a feature of AngularJS. This is not true, the Download Attribute is vanilla HTML and an awesome feature! We've all been in a situation where a client asks us to make that link automatically download a file. Now you can do that without having to write a bunch of JavaScript and fake an <iFrame> or even (GASP) use a Flash plugin to make it work. Not anymore!

Pages